I have an input field called Fleet no.
I want to test it with HTML 5 to allow the input of numbers up to a 5-digit maximum length.
I managed to enter only numbers, but it accepts only 1 digit.
I can not put more than 1 digits. This is what I tried to do:
<div> <label for="element_1">Fleet Number </label> <input id="element_1" name="element_1" type="text" maxlength="255" value="" required placeholder="Enter Digits only" pattern = "[0-9]" title='Fleet No. must contain digits only'/> </div>
munue
source share