Closed Bug 169518 Opened 22 years ago Closed 22 years ago

Form control readonly status is not remembered on reload

Categories

(Core :: Layout: Form Controls, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 38486

People

(Reporter: nick, Assigned: john)

References

()

Details

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2a) Gecko/20020917
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2a) Gecko/20020917

If you reload a page with form elements, Mozilla remembers the values of the
form elements. But it doesn't remember if a form control has dynamically been
set to readonly.

This is particularly buggy if a checkbox or radio buttons controls the readonly
status of other form controls. See "Steps to Reproduce".

Reproducible: Always

Steps to Reproduce:
1. Load the test page. The textfield is initially set to readonly.
2. Check the checkbox. The textfield is now editable.
3. Reload the page.

Actual Results:  
The checkbox is still checked, but the textfield is readonly again.

Expected Results:  
The textfield should not be readonly.

BTW, it seems that readonly textfields are not rendered differently than
editable fields in recent builds. IIRC readonly textfields had a grey background
in older builds.
We only save/restore values that can be directly changed by the user. 
http://mozilla.freezope.org/docnotes/FormBugsFAQ#save_restore_everything

*** This bug has been marked as a duplicate of 38486 ***
Status: UNCONFIRMED → RESOLVED
Closed: 22 years ago
Resolution: --- → DUPLICATE
This also applies to the "disabled" status of form elements. And it's disabled
elements that have a grey background, so ignore my comment about different
rendering of readonly elements.

Form controls that are enabled/disabled by radio buttons or checkboxes are a
common UI concept and if this isn't fixed you need ugly workarounds.

http://mozilla.freezope.org/docnotes/FormBugsFAQ#save_restore_everything also
says that the only right solutions are to remember all or nothing. But I can't
see why remembering nothing is not an option, if the current behavior is wrong.

Also, saving the readonly/disabled state requires 1 byte per form control.
That's much less than the current value which is remembered. That's not a waste
of memory.
You need to log in before you can comment on or make changes to this bug.