Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am getting a "This is a required field" error during customer checkout when the customer enters a phone number with hyphens are parenthesis. When special characters are not used it works without issues. Anyone have a solution for this problem?


enter image description here

share|improve this question
up vote 3 down vote accepted

It looks like the Telephone field is actually using a number input type:

<input type="number" name="billing[telephone]" value="" title="Telephone" class="input-text  required-entry form-control validation-failed" id="billing:telephone">

The number type only supports floating-point numbers - an input value like 555-555-5555 isn't a proper number, so the browser clears out the field right before Magento validates the input. The value is blank, so it displays the "required field" validation message.

Try using type="tel" or type="text" instead, and that should resolve your issue.

share|improve this answer
Do you know what file I would find this code in? Thank you !!!! – Tracer88 Aug 5 '14 at 8:47
Nevermind, I found the file and it worked. Thank you very much!!!!! – Tracer88 Aug 5 '14 at 9:11
I'm glad I could help! If you could mark this answer as Accepted (click the check mark) I'd greatly appreciate it! – Colin O'Dell Aug 5 '14 at 12:38

The validations are placed in js/prototype/validation.js file

The exact validation for phone is as:

['validate-phoneStrict', 'Please enter a valid phone number. For example (123) 456-7890 or 123-456-7890.', function(v) {
                return Validation.get('IsEmpty').test(v) || /^(\()?\d{3}(\))?(-|\s)?\d{3}(-|\s)\d{4}$/.test(v);

Try using phoneStrict validation.

I am checking on magento 1.9 and 1.8 version

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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