Form <input id> values remembered incorrectly when insertBefore used

RESOLVED FIXED in mozilla25

Status

()

RESOLVED FIXED
7 years ago
5 years ago

People

(Reporter: askEric, Assigned: almasry.mina)

Tracking

({testcase})

Trunk
mozilla25
testcase
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

7 years ago
Created attachment 551635 [details]
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.

Updated

7 years ago
Attachment #551635 - Attachment mime type: text/plain → text/html

Updated

7 years ago
OS: Mac OS X → All
Hardware: x86 → All

Comment 1

7 years ago
Mozilla/5.0 (Windows NT 5.1; rv:8.0a1) Gecko/20110807 Firefox/8.0a1
Confirming
Component: General → General
Product: Firefox → Core
QA Contact: general → general
Version: 5 Branch → Trunk

Updated

7 years ago
Keywords: testcase

Updated

7 years ago
Attachment #551635 - Attachment description: Source code for problem → testcase

Updated

7 years ago
Whiteboard: DUPME
It's not actually random; just a matter of indices shifting....
Depends on: 660549
Created attachment 552937 [details] [diff] [review]
wip (wdiff)

Is there a reason we don't use the ID in the state key?

Updated

7 years ago
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

Updated

7 years ago
Blocks: 673646

Comment 4

7 years ago
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...

Updated

7 years ago
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)
(Assignee)

Comment 7

5 years ago
Test case worksforme. Might have been fixed with bug 737851.
Yes.  This got fixed on the day bug 737851 landed.
Status: NEW → RESOLVED
Last Resolved: 5 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.