Posted By

melvitax on 09/05/08


Tagged

validation


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

1man
classicalart
dine
johnfmorton


Jquery Limit Input to Numbers


Published in: JavaScript 


  1. $('input.valid-number').bind('keypress', function(e) {
  2. return ( e.which!=8 && e.which!=0 && (e.which<48 || e.which>57)) ? false : true ;
  3. })

Report this snippet 

You need to login to post a comment.