0

I have this two inputs one of type text and the other number

<input type="number" class="form-control" id="phone" name="phone" placeholder="Telephone Number"  maxlength="10" pattern=".{10,}" required title="10 characters minimum"/>


<input type="text" class="form-control" id="names" name="names" placeholder="Names" pattern=".{5,30}" title="Minimum of 5 characters required"/>

the input text is able to respond when the user fills less than 5 characters but the type number does not respond when the input is less or greater than 10. It does respond however to the required rule.

How can i set the minimum characters for the input type number without having to result to javascript?.

13
  • Max in input type number define max number .not length of that number Commented Jun 25, 2017 at 16:00
  • @HimeshSuthar I have found that but its the minimum length when input is number that is problematic. Commented Jun 25, 2017 at 16:03
  • Possible duplicate of HTML5 input number min max not working with required Commented Jun 25, 2017 at 16:04
  • @thepio I am looking to accept a mimimum of ten numeric characters. Commented Jun 25, 2017 at 16:06
  • Use input type= text and put this regex . min digits 10 and max 15 pattern="\d{10,15}" Commented Jun 25, 2017 at 16:06

1 Answer 1

0

Maybe you could solve it with the min attribute of the input type number like min="1000000000".

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.