Prevent form submission on Enter key press

I have a form with two text boxes, one select drop down and one radio button. When the enter key is pressed, I want to call my JavaScript function, but when I press it, the form is submitted.

How do I prevent the form from being submitted when the enter key is pressed?

20 Answers
20

Leave a Comment