Open Bug 425653 Opened 16 years ago Updated 2 years ago

JavaScript-injected form elements don't keep their values when the page is reloaded

Categories

(Core :: DOM: Core & HTML, defect, P5)

defect

Tracking

()

People

(Reporter: tomer, Unassigned)

Details

Attachments

(1 file)

Someone show me how JavaScript-injected DOM form elements miss the autofill abilities of the form manager. This behavior make it impossible for some AJAX heavy websites to store form information in the user browser without some tricks such as hidden form elements. 


I'm attaching a testcase. Please note that the right field is injected by a script, and won't allow form filling after refreshing the page or using the history navigation, while the left one will allow. 

I've taken the DOM source (using 'view selection source') and created another HTML file without the injection script. It work there as expected.

  <form method="get">
    <input name="regular_form_element" value="" type="text"> <span id="inject_here"><input name="testing" type="text"></span> <input type="submit">
  </form>
Tested on both Firefox 2.0.x and Firefox 3b4.
Summary: Form manager don't safe information for JavaScript-injected form elements → Form manager don't save information for JavaScript-injected form elements
I don't understand the bug. If I enter some text into both elements, and submit the form, then go back to it, form fill works fine for both of them, even if I reload.

Can you provide more detailed steps to reproduce?
Fill the form, than hit the reload key. The left field stays filled, while the other not. 

The history seems to work well, since I can do the path of fill, submit, backward successfully, but even than the field losts its text after reloading the page. 


Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9b4) Gecko/2008030318 Firefox/3.0b4
Oh, that has nothing to do with the form autocomplete. The form state restoring code handles those cases, and since the element isn't in the document when the page is initially loaded, I suspect this is INVALID.
Component: Form Manager → DOM: HTML
Product: Firefox → Core
QA Contact: form.manager → general
Summary: Form manager don't save information for JavaScript-injected form elements → JavaScript-injected form elements don't keep their values when the page is reloaded
This might be a duplicate of bug 285730.
Component: DOM: HTML → DOM: Core & HTML
https://bugzilla.mozilla.org/show_bug.cgi?id=1472046

Move all DOM bugs that haven’t been updated in more than 3 years and has no one currently assigned to P5.

If you have questions, please contact :mdaly.
Priority: -- → P5
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: