I found a strange behavior and I can't explain it. My question is if following behavior is a bug or is it documented.
In the following 3 forms only two can be submitted on press enter. The first form doesn't submit on enter key. Why?
function onSubmit() {
alert('Submit');
}
First:
<form onsubmit="onSubmit(); event.preventDefault()">
<input />
<input />
</form>
Second:
<form onsubmit="onSubmit(); event.preventDefault()">
<input />
</form>
Third:
<form onsubmit="onSubmit(); event.preventDefault()">
<input />
<input />
<button></button>
</form>
A form with only one input works. A form with a button works. But a form with two inputs without buttons doesn't work.