ChrisB: Unerklärliches Verhalten bei Form Submit

Beitrag lesen

Yo!

Beim Submit über die Enter-Taste wird der erste Submit-Input übermittelt.

das ist AFAIK nicht so spezifiziert, wird aber von den meisten Browsern anscheinend gemacht.

Mit HTML5 ist es spezifiziert – http://www.w3.org/TR/html5/forms.html#implicit-submission:

“A form element's default button is the first submit button in tree order whose form owner is that form element. If the user agent supports letting the user submit a form implicitly (for example, on some platforms hitting the "enter" key while a text field is focused implicitly submits the form), then doing so for a form whose default button has a defined activation behavior must cause the user agent to run synthetic click activation steps on that default button.”

MfG ChrisB