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

java - Can't add JTree to JPanel of a JInternalFrame -

javascript - data.match(var) not working it seems -

javascript - How can I pause a jQuery .each() loop, while waiting for user input? -