Pages

Friday, November 29, 2013

HTML-Input Field that accepts only number

If you are looking for a Html Input field that accepts only number on basis of regular expression here is the code


 <input name="number"  
 onkeyup="if (/\D/g.test(this.value)) this.value = this.value.replace(/\D/g,'')">  

No comments:

Post a Comment