All users were logged out of Bugzilla on October 13th, 2018
You hit enter. We find the nearest submit element and call its onclick() function (pages expect this to happen). This function does a manual submit, which does _not_ trigger an onsubmit handler. In fact, the fact that the handler triggers when clicking on the image is due to the double-submit (the onclick submits but does not cancel the click, so the image input submits too).
If this is the right behaviour I should suppose that NS7.02 was (is!) wrong.
Created attachment 117868 [details] Testcase Current trunk does not have this problem (it fires onsubmit). I remember something like it being fixed a while back, it was a problem with our double-submit code, sure enough.
Why would you find the nearest submit element and fire it's onclick()? This would make that submit element "successful", which is contrary to HTML 4.0: http://www.w3.org/TR/REC-html40/interact/forms.html#successful-controls (in particular: If a form contains more than one submit button, only the activated submit button is successful. -- this implies that if there is more than one submit button, none of them is successful unless activated) If there is more than one submit button, and "enter" is pressed in a text input field, NO submit button should be activated, otherwise the results are ambiguous as to which submit button should be activated. This ALSO occurs with "<input type=image" form buttons, where ONE of the image inputs will be submitted with input.x and input.y set to 0,0. Which is also "wrong" (I'll look a bit more for a bug specific to this). Regards, Sam
Pressing enter *activates* the first submit button. There's nothing in the spec to say a user agent can't choose one of the buttons and activate it, and this is the expected behavior and is non-ambiguous (the first button, only the first button, and always the first button). It is also not the subject of this bug.
Yes, thanks. I've filed another bug after searching, which has been marked as a dup. Looking at the dup now :) Is it the "first" or the "nearest" submit button, by the way? Replies in this thread have been confilcting on that issue. Regards, Sam
This is invalid. What NS 7.02 was doing was deliberately changed to the current behavior. Sam, it's the first submit button. My initial comment was incorrect.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 15 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.