This was posted in HTML. It was suggested that this might be the more appropriate forum. Apologies for x-post.
On a form, if someone hits the "Enter" key after filling in a text field then the form gets submitted. Is there any way to prevent the "Enter" key from submitting (except where the submit button has the focus)?
I have tried various combinations of onClick and onKeypress, manipulating this.value, and also the value of a hidden field.
All to no avail.
Anybody able to help?
On a form, if someone hits the "Enter" key after filling in a text field then the form gets submitted. Is there any way to prevent the "Enter" key from submitting (except where the submit button has the focus)?
I have tried various combinations of onClick and onKeypress, manipulating this.value, and also the value of a hidden field.
All to no avail.
Anybody able to help?