Skip to content

Instantly share code, notes, and snippets.

@josedaniel
Created May 3, 2011 10:31
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 josedaniel/953131 to your computer and use it in GitHub Desktop.
Save josedaniel/953131 to your computer and use it in GitHub Desktop.
Avoid letters in number inputs
$(document).ready(function(){
//cuando se intenten meter letras en un campo de precio
$('.cantidad_producto').keypress(function(e){
if( e.which!=8 && e.which!=0 && (e.which<48 || e.which>57)){
return false;
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment