Forum Moderators: open
I have a simple form with a submit button. Usually pressing the Enter key on the keypad submits the form. But in this case it doesn't. The button has to be in focus for that to happen. (Or it has to be clicked).
I don't remember coding anything differently on this form.
Is there some guidelines about when the Enter key works and when it doesn't?
The form is on a popup window, called via jscript on the window.open command. Does that matter?
It is said that to submit a form using the return key it should have only one text input (<input type="text" ... >) and no textarea (as you can hit return here and it drops the cursor down a line). The W3C is vague but does say the the enter key activates a selected element. (Green text at the end of this section [w3.org]).
The most surefire way of ensuring the behaviour you want, be it enter submitting or not submitting the form, is to use a script to sniff for the enter keypress on the form and do or not do its thing!
HTH