Closed Bug 376294 Opened 19 years ago Closed 19 years ago

Reload button does not clear data set with document.form.<hidden input>.value='New value'

Categories

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

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 235929

People

(Reporter: duncan.loveday, Unassigned)

Details

Attachments

(1 file)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a4pre) Gecko/20070331 Minefield/3.0a4pre Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9a4pre) Gecko/20070331 Minefield/3.0a4pre Given an HTML <form> containing <input name="hiddenInput" type="hidden" value="Initial value">, if the value is updated from a script using document.form.hiddenInput.value='New value' then the value set persists even after the page is reloaded. In contrast, if the value is updated from a script using document.form.hiddenInput.setAttribute('value', 'New value') then the value set is reset when the page is reloaded. Reproducible: Always Steps to Reproduce: 1. Open the attached HTML test case. 2. Click the buttons to read the data using document.form.hiddenInput.value and/or document.form.hiddenInput.getAttribute('value'). 3. Click the button to set a new value using document.form.hiddenInput.setAttribute('value', 'New value'). Repeat step 2. 4. Click the reload button and repeat step 2. 5. Repeat steps 3 and 4 but this time click the button to set a new value using document.form.hiddenInput.value='New value'.. Actual Results: The first time step 2 is performed, an initial value is displayed. In step 3, a new value is displayed. In step 4, the initial value is reinstated after the reload button is clicked. In step 5, a new value is displayed but is NOT reinstated when the reload button is clicked. Expected Results: Clicking the reload button should revert all changes made to the page by scripts, so in step 5 the value should revert to the initial value when the reload button is clicked.
Attached file test HTML source —
Not sure this is really form submission as such but couldn't find a better home for it.
Status: UNCONFIRMED → RESOLVED
Closed: 19 years ago
Resolution: --- → DUPLICATE
Component: HTML: Form Submission → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: