Reputation: 22035
Usually if you type text into form fields, then navigate away from the page, then press the back button to go back, the text should still be there.
However, in firefox, if you use javascript to insert another form element somewhere in the page, all forms below the dynamically inserted form will no longer remember typed in text as they should.
See http://jsfiddle.net/NUC3w/7/ for a demo.
In firefox, enter data in the 2 fields, click the link and then click your back button. The second form input value isn't remembered. Comment out the javascript insertion of the form, and everything works normally.
It works as expected in Chrome and IE8.
Upvotes: 4
Views: 1447
Reputation: 700302
There is no specific behaviour that is expected. There is no standard for this behaviour, so there is no definite right or wrong.
Firefox is simply more restrictive when repopulating the fields. When the order of the fields doesn't match how the page looked when you left it, it obviously stops trying to match the fields with the previous data.
The other browsers that you mentioned seems to be more relaxed in how they repopulate the fields. That of course also means that there is a higher risk for them to put the wrong information in the fields in certain situations.
You can reduce the risk for differences in behaviour by only adding fields last, but as long as you add fields using client script, you can't rely on all browsers behaving the same.
Upvotes: 2