0

I am using type as number for input field. On clicking on top & down arrows of input field, we are able to select upto max length 99. But If I enter I can able to enter many values(numbers). It's issue in chrome? I provided restriction for maxlength as 2. But its not working. How to restrict?

        <input type="number" min="1" max="99" maxlength="2"> 
Veera Bhadra
  • 200
  • 3
  • 13

1 Answers1

0

Try this instead.

<input type="number" onKeyDown="if(this.value.length==2) return false;" />
deviantxdes
  • 469
  • 5
  • 17