Pressing Enter should submit form using next submit button, not first




16 years ago
15 years ago


(Reporter: timwi, Unassigned)



Firefox Tracking Flags

(Not tracked)





16 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 WebWasher 3.2
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 WebWasher 3.2

A lot of webpages I've seen have several submit buttons inside one big <form>.
I know it's better practice to make them smaller forms, but:

Would it be possible to change the behaviour of the Enter key to submit the form
using the submit button following the form element that has focus?

Take, for example, the URL above. Go to where it says
"Your other subscriptions"
and type in some bogus password and press enter. You will receive this:
"You must give your password to unsubscribe."
because Mozilla submitted the form using the Unsubscribe button in the
left-hand-side part of the form.

Of course I am aware that it is possible to construct a webpage where the
submit button comes before other elements. However, I'm pretty sure that the
way I've described will make Enter work "correctly" on more forms than the
current behaviour. I see a lot more webpages with several submit buttons in
one big form, than webpages where the submit button is not the last element.

Reproducible: Always

Steps to Reproduce:

Comment 1

16 years ago
This was also mentioned in bug 151219 : read bug 151219 comment 3 and bug 151219
comment 6, which mention that the current behaviour is for compatibility with
Internet Exploder. Note that Mac IE 5 has the same 'bug' (don't know about
Windooze IE).

If this is really a problem on a certain form, then the form should be fixed.

Comment 2

16 years ago
That sounds like one of the silliest arguments I've ever heard. Do you also mimic
all of IE's bugs? If you're so fond of copying IE, why does Mozilla exist at all
and you all doesn't just use IE?

/me imagines a BugZilla entry, "Component XYZ does not exhibit same bug as IE" :-p

Comment 3

15 years ago
however annoying this may be, it's not going to be changed any time soon. (see
also: bug 156683) i just ran into this "bug" in a product i'm building; after
some research, i learned that the behaviour is not peculiar to mozilla or MSIE.
as discussion in other bugs has explained, this behaviour originated as
compatibility with netscape 4. mozilla's behavior is the same as mozilla, MSIE,
safari, and possibly other browsers. the number of products that would be broken
by "fixing" this would be huge.

Last Resolved: 15 years ago
OS: Windows 2000 → All
Hardware: PC → All
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.