Thursday 5 July 2012

Form not submitting on pressing enter

Some browsers have this problem, just add the below piece of code
var code = (e.keyCode ? e.keyCode : e.which);
if(code == 13) { //Enter keycode
  //call submit function and do whatever you want to
}
Reference:http://stackoverflow.com/questions/302122/jquery-event-keypress-which-key-was-pressed 

No comments:

Post a Comment