Closed
Bug 190559
Opened 22 years ago
Closed 21 years ago
[FIXr]checkbox and radio do not submit by clicking submit button
Categories
(Core :: Layout: Form Controls, defect, P2)
Core
Layout: Form Controls
Tracking
()
RESOLVED
FIXED
mozilla1.7alpha
People
(Reporter: john, Assigned: bzbarsky)
References
(Blocks 1 open bug)
Details
Attachments
(3 files, 1 obsolete file)
(deleted),
text/html
|
Details | |
(deleted),
text/html
|
Details | |
(deleted),
patch
|
Details | Diff | Splinter Review |
When you hit enter on a checkbox or radio button, it submits the form but does
not click any submit button. Pressing enter in an input submits by clicking a
submit button, so these should click the same one and use the same algorithm.
IE exhibits the desired behavior.
Reporter | ||
Comment 1•22 years ago
|
||
Focus a checkbox and hit enter. A "clicked" alert should come up and x=y
should show on the URL line, but it does not.
Reporter | ||
Comment 2•22 years ago
|
||
(Note that they *do* submit, they just don't submit using the input type=text
algorithm.)
Assignee | ||
Comment 3•21 years ago
|
||
Assignee | ||
Comment 4•21 years ago
|
||
Neil, any chance you could test IE on the second testcase here and let me know
what it does?
Assignee | ||
Comment 5•21 years ago
|
||
Whether this is good depends on what IE does on that testcase...
Assignee | ||
Comment 6•21 years ago
|
||
Taking
Assignee: form → bz-vacation
OS: Windows XP → All
Priority: -- → P2
Hardware: PC → All
Summary: checkbox and radio do not submit by clicking submit button → [FIX]checkbox and radio do not submit by clicking submit button
Target Milestone: --- → mozilla1.7alpha
Comment 7•21 years ago
|
||
FWIW, IE5 behaviour appears to be as follows:
1. If the form has exactly one ordinary input, which has the focus, then submit
*without* clicking the submit button, for Netscape 4.x compatibility.
2. If a submit button exists, then click it.
3. Otherwise, don't submit.
Mozilla 1.4 appears to be as follows:
1. If the focus is not on an ordinary input, then submit.
2. If a submit button exists, then click it.
3. If the form has exactly one ordinary input, then submit.
4. Otherwise, don't submit.
So, the behaviour differs for all checkboxes plus form 6's input.
Assignee | ||
Comment 8•21 years ago
|
||
By "ordinary input" you mean <input type="text">?
So in form 6, hitting enter on the checkbox clicks the button? And hitting
enter on the text input does not?
Assignee | ||
Comment 9•21 years ago
|
||
Oh, I recall now. The difference for the text input in form 6 we introduced
purposefully. See bug 147850
So to recap. The behavior when hitting enter on the various inputs in IE is as
follows:
Form 2: does not submit
Form 3: submits on textfield, not on checkbox
Form 4: does not submit
Form 5: submits by clicking button
Form 6: submits by clicking button on checkbox, just submits on textfield
Form 7: submits by clicking button
That about sum it up?
With the patch I attached, our behavior is like that with two exceptions: The
form 6 exception you pointed out, and we submit on the checkbox in form 3. That
seems a little more consistent to me....
Comment 10•21 years ago
|
||
Looks good to me.
Assignee | ||
Comment 11•21 years ago
|
||
Comment on attachment 136159 [details] [diff] [review]
Possible patch
jst, what do you think?
Attachment #136159 -
Flags: superreview?(jst)
Attachment #136159 -
Flags: review?(jst)
Comment 12•21 years ago
|
||
Comment on attachment 136159 [details] [diff] [review]
Possible patch
I don't like the fact that hitting enter causes a click event to be generated,
but given that that's the way the web expects browsers to work, we don't really
have a choice...
r+sr=jst
Attachment #136159 -
Flags: superreview?(jst)
Attachment #136159 -
Flags: superreview+
Attachment #136159 -
Flags: review?(jst)
Attachment #136159 -
Flags: review+
Assignee | ||
Updated•21 years ago
|
Summary: [FIX]checkbox and radio do not submit by clicking submit button → [FIXr]checkbox and radio do not submit by clicking submit button
Assignee | ||
Comment 13•21 years ago
|
||
Attachment #136159 -
Attachment is obsolete: true
Assignee | ||
Comment 14•21 years ago
|
||
Checked in for 1.7a.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•