Skip to content

Instantly share code, notes, and snippets.

@JacobBennett
Last active January 3, 2016 03:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JacobBennett/8403792 to your computer and use it in GitHub Desktop.
Save JacobBennett/8403792 to your computer and use it in GitHub Desktop.
Limits inputs to only accept numbers (Jquery Required)
$('input.valid-number').bind('keypress', function(e) {
return ( e.which!=8 && e.which!=0 && (e.which<48 || e.which>57)) ? false : true ;
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment