Posted By

tylerhall on 07/24/06


Tagged

form regex textmate numbers validation only


Versions (?)

Who likes this?

3 people have marked this snippet as a favorite

mate
irdial
dojob


Numbers only


 / Published in: JavaScript
 

Use with onkeyup="numbersOnly(this)"

  1. function numbersOnly(el)
  2. {
  3. el.value = el.value.replace(/[^0-9]/g, "");
  4. }

Report this snippet  

You need to login to post a comment.