On Chrome and Firefox, a form is submitted if the return key is pressed inside any text input inside the form.
Is this behaviour part of the standard?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No, this behavior is not required. I’m afraid it isn’t even mentioned in the HTML 4.01 specification, though this is probably just an oversight.
But it is very common behavior and needs to be taken into account: users may well accidentally submit form data by pressing Enter, when they still intended to continue filling it out.
There are some browser differences, e.g. IE 9 does not do anything when Enter is pressed in a field provided that a) there are more than one text input fields there and b) there is no submit button. On older versions, condition a) was sufficient, and this was more or less the original idea (the feature was meant to make it easy to use very simple search forms without causing confusion).