I have the following code snippet.
$("#days").keypress(function(e){
if(e.keyCode == 13){
self.validateNightModalForm();
}
});
basically, it checks for enter then invoke a function.
My only problem is that IE8 also clicks a button. When I hit enter. I’ve checked it with all other browsers, but only IE8 does this.
Is there any way to prevent it?
Try adding those two lines:
Hopefully this will stop the keypress event from “going up” and trigger the form submit.