Last Comment Bug 693025 - Form submission fails if a "required" input is empty and display:none
: Form submission fails if a "required" input is empty and display:none
Status: RESOLVED DUPLICATE of bug 595451
Product: Firefox
Classification: Client Software
Component: General (show other bugs)
: 6 Branch
: x86_64 Linux
-- normal (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
Depends on:
  Show dependency treegraph
Reported: 2011-10-07 22:28 PDT by Richard Neill
Modified: 2011-10-08 07:37 PDT (History)
0 users
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Description User image Richard Neill 2011-10-07 22:28:04 PDT
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:

<div style='display:none'>
<INPUT TYPE="text" NAME="field1" required>
<INPUT TYPE="text" NAME="field2" required>
<INPUT TYPE="submit" value="clickme">

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.
Comment 1 User image Mats Palmgren (:mats) 2011-10-08 06:24:02 PDT
See discussion in bug 595451.
Comment 2 User image Richard Neill 2011-10-08 07:37:43 PDT
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.

*** This bug has been marked as a duplicate of bug 595451 ***

Note You need to log in before you can comment on or make changes to this bug.