I want to apply validation with 10 digit mobile number on telephone field in billing information in magento checkout page.

For this I tried pattern="\d{10}" with type="tel" but it is not working.

How to do that?

  • Have you checked Regular expression? Commented Nov 4, 2016 at 7:01

2 Answers 2


try this

<input type="text" name="billing[telephone]" value="" title="Telephone" class="input-text  required-entry validate-length maximum-length-10 minimum-length-10 validate-digits" id="billing:telephone" placeholder="Mobile">
  • its working for an upper limit but lower limit still doesn't work means i can be procced even by entering 1 digit
    – inrsaurabh
    Commented May 11, 2017 at 10:46

You can set pattern like below,

pattern="^\d{10}$" with type="tel"

Remove/clear cache and check again.

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.