jQuery disable Enter Key on text inputs
3/08/12

A simple jQuery script to disable the enter key on text inputs which helps avoid accidental form submissions.
 
$("input:text").keypress(function (evt) {
  var charCode = evt.charCode || evt.keyCode;
  if (charCode  == 13) return false;
});	
 
Tags: code, fyi


Entry ID: 000506