1

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? – Rakesh Jesadiya Nov 4 '16 at 7:01
5

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 May 11 '17 at 10:46
1

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, privacy policy and cookie policy

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