This is a text box. See ... I set the maxlength property to 10. Thus, only 10 characters can be entered
<input maxlength="10" id="txt_name" name="txt_name" type="text" required="required"/>
This is a field of numbers. I want this to also have a maximum length of 10 so that users can enter their 10-digit mobile number. This restricts user access to additional numbers.
<input id="txt_mob" name="txt_mob" type="number" maxlength="10"/>
But the maxlength function works with numeric fields. What for?? Is there a way to do this without using javascript or jQuery?
Here is FIDDLE .
user4044890
source
share