Skip to content

Instantly share code, notes, and snippets.

@shohag-cse-knu
Created September 10, 2018 11:34
Show Gist options
  • Save shohag-cse-knu/ef2c873810dd59c74d1936a1ef456491 to your computer and use it in GitHub Desktop.
Save shohag-cse-knu/ef2c873810dd59c74d1936a1ef456491 to your computer and use it in GitHub Desktop.
Form submission when enter key is pressed in any form fields
jQuery('#form_field_1,#form_field_2,#form_field_3').keypress(function(event){
var keycode = (event.keyCode ? event.keyCode : event.which);
if(keycode == '13'){
//your necessary code here
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment