Skip to content

Instantly share code, notes, and snippets.

@weslley39
Last active August 29, 2015 13:56
Show Gist options
  • Save weslley39/9094917 to your computer and use it in GitHub Desktop.
Save weslley39/9094917 to your computer and use it in GitHub Desktop.
Verify is the key pressed is a letter, if not, deletes the number
function isLetterKey(evt)
{
evt = (evt) ? evt : event;
var charCode = (evt.charCode) ? evt.charCode : ((evt.keyCode) ? evt.keyCode :
((evt.which) ? evt.which : 0));
if (charCode > 31 && (charCode < 65 || charCode > 90) &&
(charCode < 97 || charCode > 122)) {
return false;
}
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment