How do I restrict user input to a given length in an HTML5 input[type=number] textbox?
input[type=number]
the answers to
How can I limit possible inputs in a HTML
I don't know my answer is useful for you? But i happy if i can help you. you should write a js method and then use it in your html page.
function limit(element) { var max_chars = 2; if(element.value.length > max_chars) { element.value = element.value.substr(0, max_chars); } }