Form 에서 Enter키로 submit방지

Enter키를 누르면 서브밋이 될때 방지 하기.

$('input[type!="submit"][type!="button"]').keypress(function(e){
  if ((e.which && e.which == 13) || (e.keyCode && e.keyCode == 13)) {
    return false;
  }else{
    return true;
  }
});

Via : http://snowland.net/nucleus/item/3329

Leave a Reply

Your email address will not be published. Required fields are marked *