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

NEW
Unassigned

Status

()

Core
DOM: Core & HTML
10 years ago
9 years ago

People

(Reporter: tomer, Unassigned)

Tracking

Trunk
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

10 years ago
Created attachment 312252 [details]
Javascript form injection testcase

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>
(Reporter)

Comment 1

10 years ago
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?
(Reporter)

Comment 3

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

Updated

9 years ago
Component: DOM: HTML → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.