Closed Bug 677430 Opened 13 years ago Closed 11 years ago

Form <input id> values remembered incorrectly when insertBefore used

Categories

(Core :: General, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla25

People

(Reporter: askEric, Assigned: almasry.mina)

References

Details

(Keywords: testcase)

Attachments

(1 file, 1 obsolete file)

Attached file testcase
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; rv:5.0.1) Gecko/20100101 Firefox/5.0.1
Build ID: 20110707182747

Steps to reproduce:

Verified this happens on Windows [xp/vista] and OSX with Firefox 5. 

Page contains a form that has 5 texboxes. JavaScript appends a button after the textbox. User enters text into the texboxes. User Refreshes the page. 

Active test page: http://www.pascarello.com/tempFiles/bugs/firefox5append.html 
Same as the attached file.  


Actual results:

When the page is rendered after the refresh, the textboxes randomly revert to default value, save value that was entered, or switch values with other textboxes above it. Keep refreshing and more random values are replaced.



Expected results:

The textboxes should hold their value entered by the user or revert back to the default value.
Attachment #551635 - Attachment mime type: text/plain → text/html
OS: Mac OS X → All
Hardware: x86 → All
Mozilla/5.0 (Windows NT 5.1; rv:8.0a1) Gecko/20110807 Firefox/8.0a1
Confirming
Product: Firefox → Core
QA Contact: general → general
Version: 5 Branch → Trunk
Keywords: testcase
Attachment #551635 - Attachment description: Source code for problem → testcase
Whiteboard: DUPME
It's not actually random; just a matter of indices shifting....
Depends on: 660549
Attached patch wip (wdiff) (obsolete) — Splinter Review
Is there a reason we don't use the ID in the state key?
Status: UNCONFIRMED → NEW
Ever confirmed: true
Summary: Form values remembered randomly and incorrectly when insertBefore used → Form <input id> values remembered incorrectly when insertBefore used
Whiteboard: DUPME
Blocks: 673646
Eric Pascarello, to improve behaviour in your case slightly, you can add "name" attributes to your inputs with the same values as your ids.
(In reply to Mats Palmgren [:mats] from comment #3)
> Is there a reason we don't use the ID in the state key?

Oh, I see this is being discussed in bug 660549...
Attachment #552937 - Attachment is obsolete: true
Depends on: 737851
This happens with INPUT[TYPE=HIDDEN] elements as well!  Every time Firefox pushes a major update, I spend hours trying to figure out why a hidden input that is ONLY set on the server side and NEVER altered on the client side suddenly contains a value that NEVER should have been assigned to it, only to realize that Firefox is bungling about.

The only workaround I've found is to make certain that autocomplete="off" is implemented on affected elements.

(Firefox 16, Windows Vista)
Test case worksforme. Might have been fixed with bug 737851.
Yes.  This got fixed on the day bug 737851 landed.
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Assignee: nobody → malmasry
Target Milestone: --- → mozilla25
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: