Closed Bug 97537 Opened 23 years ago Closed 23 years ago

Form values get reset on javascript:history.back()

Categories

(Core :: DOM: Navigation, defect)

defect
Not set
normal

Tracking

()

VERIFIED DUPLICATE of bug 101682

People

(Reporter: yohgaki, Assigned: radha)

References

()

Details

From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.3+) Gecko/20010828
BuildID:    2001082822

I have javascript link like
<a href="javascript:history.back()"></a> it works, but when browser displys
previouly view page, all form values are get reset.

If I hit browser's back button, mozilla displys previously entered values for
form elements.

Reproducible: Always
Steps to Reproduce:
1. Enter values to form elements
2. submit
3. click link that I've mentioned

Actual Results:  All form elememnts are reset and no vlaue in it.

Expected Results:  Form elements with values that are previously entered.

I also verfied with W2K/Mozilla 2001080603. It doesn't work as well.

For PHP generated forms, mozilla always reset form elements value. I'll  report
this bug, after playing with this problem a bit more.

BTW, is this design change? If so, this is wrong way to do. Web programmer must
be responsible for multiple submit of the same data.
Reporter: Do you have a test page for this?
Summary: Form vlaue get reset → Form vlaue get reset
Old summary:
Form vlaue get reset

New summary:
Form values get reset on javascript:history.back()
Summary: Form vlaue get reset → Form values get reset on javascript:history.back()
Ok I've made it. <a href="javascript:history.back()"> works with older mozilla, 
NN4.51 and IE, but not with my mozillas one I've got.
(I haven't test with older mozilla, but I'm sure it worked with 0.9.2 at least)

Sorry, I should have include this in first place :)

=== BEGIN ===
<html>
<head>
<title>JS history back test</title>
</head>

<body>
<form name="form" method="post">
<input type="text" name="textfield1">
<input type="text" name="textfield2">
<input type="text" name="textfield3">
<input type="submit" name="submit" value="submit">
<a href="javascript:history.back()">back</a> 
</form>
</body>
</html>
=== END ===
FYI:
I tested against Netscape6.01/ja, it works as it supposed to. It seems it 
stopped working from mozilla 0.9.3.
Confirming and marking NEW.

A better testcase:
1. Goto url above (http://www.google.com)
2. Enter a search query (such as "mozilla") and click "Google Search"
3. Once the search-results page finishes loading, enter this code in the url bar
and press enter: 
javascript:history.back()
4. Notice that input field is blank.

-> History: session-> All/All. 

Dupe of bug 41555?
Severity: critical → normal
Status: UNCONFIRMED → NEW
Component: Layout → History: Session
Ever confirmed: true
OS: Linux → All
Hardware: PC → All
I stumbled across something interesting that may help someone debugging this one.

In Mozilla 0.9.5 (build 2001101202) I get the described behaviour in the test
case of "2001-08-31 11:40" below.

If I then press 'Reload' my query is magically restored.

In other words the values are all there in the memory but have not been put back
in the form .

I hope this helps.
-->history owner
Assignee: karnaze → radha
QA Contact: petersen → claudius
I believe this could have been fixed by 101682 that I fixed last week. Can
someone verify that? 
This indeed got fixed by 101682. Markig dupe of 101682

*** This bug has been marked as a duplicate of 101682 ***
Status: NEW → RESOLVED
Closed: 23 years ago
Resolution: --- → DUPLICATE
mass-verifying Duplicate bugs which haven't changed since 2001.12.31.

set your search string in mail to "CitizenGKar" to filter out these messages.
Status: RESOLVED → VERIFIED
Component: History: Session → Document Navigation
QA Contact: claudius → docshell
You need to log in before you can comment on or make changes to this bug.