Im working with jquery validation, but if the all element is valid then i press enter, the form is submit, i want to submit form ONLY via submit button not with enter key, how to fix that?
Asked
Active
Viewed 4,715 times
1 Answers
0
Enter key is the keydown number 13. You should use the following code.
$(document).ready(function() {
$('input').keydown(function(event){
if(event.keyCode == 13) {
event.preventDefault();
return false;
}
});
});

Nathan Clarke
- 13
- 4