Magento uses Prototype library to manage form validation of input fields
. This comes in handy, because all you need to do when writing custom form is to assign a valid class names
to your input fields, and pass the form id to VarienForm object.
you need add css class validate-phoneStrict
at field which will do this type validation. you need to remove validate-number etc validation
You need see js field validation at js\prototype\validation.js
<input type="tel" name="billing[telephone]"
value="<?php echo $this->escapeHtml($this->getAddress()->getTelephone()) ?>"
title="<?php echo $this->__('Telephone') ?>" class="validate-phoneStrict
input-text <?php echo $this->helper('customer/address')->getAttributeValidationClass('telephone') ?>"
id="billing:telephone" />
and you can also do below format:
(123) 456-7890 or 123-456-7890