What does the HTML spec say about using enter key to submit a form?
I’ve read http://www.w3.org/TR/html4/interact/forms.html but nothing there about submitting a form using the enter key.
Is it even defined somewhere or is it just the way most browsers have implemented it on their own and it became the way to do it?
I’m curious because I just asked a question regarding Webkit not submitting my form if the submit button is hidden (display: none).
Trying to 'submit' my form when hitting enter fails
So is there somewhere in the official docs a reference to the behavior of the enter key in a form?
The HTML standard is device-agnostic; HTML user agents run on a variety of platforms, many of which (think search engine, voice reader, webscraper) do not have a keyboard in the first place. Therefore, the standard does not say how a user can toggle the form submission. Listing all possible ways to submit a form is impossible, since many devices and user interaction mechanisms are not invited yet – iOS 6 may allow you to submit a form by saying “Submit Form!”.
The Webkit behavior you’re seeing is up to the discretion of Webkit and likely unintentional. The standard does not say anything about a submit button being necessary in the submission process.