HI WELCOME TO KANSIRIS

Limit possible inputs in a HTML5 “number” element

Leave a Comment

In order to restrict number input to 6 characters follow below process

<input type=”number” pattern=”/^-?\d+.?\d*$/” onKeyPress=”if(this.value.length==6) return false;”/>

Here in onKeyPress i’ve mentioned max limit as 6 you can replace it with your desired number with which you want to validate

0 comments:

Post a Comment

Note: only a member of this blog may post a comment.