For <input type="number"> element, maxlength is not working. How can I restrict the maxlength for that number element?
For <input type=number> element, maxlength is not working. How can I restrict the maxlength
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
And you can add a
maxattribute that will specify the highest possible number that you may insertif you add both a
maxand aminvalue you can specify the range of allowed values:The above will still not stop a user from manually entering a value outside of the specified range. Instead he will be displayed a popup telling him to enter a value within this range upon submitting the form as shown in this screenshot: