I'm using below html tag and not able to get the restrictions on numbers, I need user to enter 12 digit only however as per HTML tag by default 'maxlength' does not work with <input type ="number">
, I tried min and max tag, it did not help either.
Could you share if any way to do it in HTML only?
<input type="number" name="Aadhar" maxlength="12" placeholder="xxxx-xxxx-xxxx" pattern="[0-9]{4}-[0-9]{4}-[0-9]{4}" required>
Use max instead of maxlength
When the user will click on Submit Button It will show that the value should be less than 12. This can be only used inside a form.