Bug 24010 - textarea: initial values changed after submitting form
Summary: textarea: initial values changed after submitting form
Status: UNCONFIRMED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Nobody
URL: http://bartdegoeij.nl/webkit/form.php
Keywords:
Depends on:
Blocks:
 
Reported: 2009-02-18 14:05 PST by BARTdG
Modified: 2010-03-31 15:02 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description BARTdG 2009-02-18 14:05:21 PST
I 've got 2 html files:

form.php, which has a simple form with an input-text control and two textareas. textarea1 doesn't have an initial value, textarea2 does.

The target of the form is confirm.php. confirm.html has a link which sends me back to form.php by means of javascript: history.back().

When I enter text in all 3 form controls and submit the form, and click the javascript "back"-link, all the entered text is still in the form controls.

This may have to do with the back/forward cache: http://developer.apple.com/internet/safari/faq.html#anchor5.

To override this, I added the suggested http-headers to form.php, included an invisble iframe, but the entered values are still there.


When I now press the reset-button on form.php, the input-text control is reset to the initial value, specified in the source code. But the textareas keep the text entered before.

Then, when I change the text in the textareas and hit Reset, their values are changed back to the texts, entered before.

Expected behaviour is, that textareas are changed back to the initial values indicated by the html source code, like other form controls.


Testcase:
http://bartdegoeij.nl/webkit/form.php

Steps to reproduce:
1. Fill in all form controls.
2. Submit the form.
3. In confirm.php, click Back. (Or use the browser's back button.)
4. Notice the input-text is empty again.
5. Notice the texts entered earlier are still in the textareas.
6. Hit the reset button.
7. Notice nothing changes.
8. Fill in the form controls again with new text.
9. Hit reset.
10. Notice the input-text is empty again.
11. Notice the texts entered earlier are still in the textareas.

(Web Inspector shows that the Defaultvalue is not equal to the value in the html source code. It seems like the initial value of all form controls is controlled by the html source code, but the initial value of a textarea is changed to whatever is in the browser cache.)
Comment 1 Kent Tamura 2010-03-30 22:43:14 PDT
I reproduced this issue with Safari 4.0.5, but not with Safari 4.0.5 + WebKit r56823.
Comment 2 Alexey Proskuryakov 2010-03-31 15:02:23 PDT
Can a regression test be made for this?