Closed Bug 693025 Opened 13 years ago Closed 13 years ago

Form submission fails if a "required" input is empty and display:none

Categories

(Firefox :: General, defect)

6 Branch
x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 595451

People

(Reporter: rn214, Unassigned)

Details

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:6.0.2) Gecko/20100101 Firefox/6.0.2 Build ID: 20110909092056 Steps to reproduce: Consider the following: <FORM> <div style='display:none'> <INPUT TYPE="text" NAME="field1" required> </div> <INPUT TYPE="text" NAME="field2" required> <INPUT TYPE="submit" value="clickme"> </FORM> i.e. a form where a REQUIRED field is also invisible to the user because of display:none Actual results: The user fills in field2, but cannot see field1 (and so leaves it blank). On clicking Submit, Firefox correctly warns that the input field1 must be given data, but the user can't actually see that field, and the whole thing jams up. The user cannot submit the form, either with, or without the field1. Expected results: Obviously this is a stupid thing for the web-designer to have done, but Firefox could perhaps do better. My suggestion is that, on identifying a form element as requiring data, firefox should re-enable the block display of the container. Alternatively, it could pop-up a dialog box to ask for the input value, or it could ignore the "required"-ness.
See discussion in bug 595451.
Thanks for your comment; sorry for the duplicate. BTW, I did search quite hard for this bug before filing it, searching for any instances of "display" AND "required", but failed to find #595451. If anyone can explain to me (offline) how I should have found it, I'd be grateful for the tip; I know duplicates are a nuisance.
Status: UNCONFIRMED → RESOLVED
Closed: 13 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.