Closed Bug 151219 Opened 22 years ago Closed 22 years ago

Pressing Enter should trigger the submit button of the current form, not the first submit button that's found

Categories

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

x86
Windows 2000
defect
Not set
normal

Tracking

()

VERIFIED DUPLICATE of bug 28763

People

(Reporter: deanis74, Assigned: john)

References

()

Details

Searched but couldn't find a dupe for this.

1. Go to http://bugzilla.mozilla.org/query.cgi
2. In the first email field enter "dean_tessman@hotmail.com"
3. Press Enter

Expected Results: Search Executes

Actual Results: A "boolean chart" is added to the form because that's the first
submit button that's found.  This seems counter-intuitive to me.  If I'm
entering data in a form and want to submit it, pressing Enter should submit the
form I'm working in, regardless of whether there's a subform or not.

*** This bug has been marked as a duplicate of 28763 ***
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → DUPLICATE
No, this isn't a duplicate.  That bug is for a specific bugzilla issue, this is
a general form submission bug.  The bugzilla query page just provides a nice
example.
Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---
Someone want to suggest a good alternative to picking the first submit button? 
I don't really think we're going to change this, because IE does it this way too
and we're specifically mimicking their behavior.  Any button we pick is going to
break somebody, so we may as well pick the same button IE does.
I kind of liked my idea.  Pick the submit button for the form that corresponds
to the field that has focus.
What is a "subform"?  Exactly what feat of mind-reading are we supposed to
perform to determine which submit button you would want used?

I feel that IE compat is the only way to go here, since there are no convincing
arguments for picking a different submit element.. if there are, please present
them.
> Pick the submit button for the form that corresponds to the field that has focus.

What does that mean?  In HTML there is no correspondence between fields and
submit buttons.  There is a one-to-many relationship between forms and fields
and a one-to-many relationship between forms and submit buttons.  That is all.

Huh.  Can we just forget everything I said?  I could have sworn that I looked
the other day and the query page contained a form embedded within a form, and
that the Add buttons corresponded to the embedded form.  Now I see it's all one
form, and all we can do is pick the first submit.  I guess this is bug 28763
after all.

*** This bug has been marked as a duplicate of 28763 ***
Status: REOPENED → RESOLVED
Closed: 22 years ago22 years ago
Resolution: --- → DUPLICATE
> a form embedded within a form

That's actually explicitly disallowed by the HTML DTD and our parser enforces
that... ;)

Verified that the whole mess sucks.
Status: RESOLVED → VERIFIED
> That's actually explicitly disallowed by the HTML DTD

Jeez, yeah.  What the heck was I on??
Component: HTML: Form Submission → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.