I have been creating a form that I want to validate. However if the user clicks on the enter key it submits the form before it is finished. I found a simple jQuery script that does exactly what I need:
$("#myForm").bind("keypress", function(e) {
if (e.keyCode == 13) return false;
});
if (e.keyCode == 13) return false;
});
I modified this from Code Snippets.

Add A Comment