Only numbers (or whatever) in a field


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. // activate with onkeyup
  2. function checkField(thisField) {
  3. thisField.value = thisField.value.replace(/[^0-9]/g,"");
  4. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.