html - check number of digits onchange javascript -


Hi I have a number input, so it works well in Explorer because there is no arrow in it and Chrome and new browsers It does not take into account the maximum length.

  & lt; Input type = "text" id = "amount2" name = "quantity2" class = "amountBox" value = "0" onchange = "changecountmount (this.value)" maxlength = "4" onkeypress = "return / / dd.test (String.fromCharCode ((event || window.event) .which || (event || window .event) .which))); "/>  

Maybe I can change the onkeypress function to check the quantity of digits?

Thank you very much.

Use the 'maximum' attribute to specify the length.


Comments

Popular posts from this blog

Active Directory Authenticated Proxy Server with Squid or CNTLM -

java - @PluginTarget(Node.class) not registering as neo4j plugin -

python - Calculate STD manually using Groupby Pandas DataFrame -