How to validate the phone number in the form field to be in this format: XXX-XXX-XXXX | XM Community
Solved

How to validate the phone number in the form field to be in this format: XXX-XXX-XXXX

  • 7 May 2021
  • 1 reply
  • 694 views

Hello all!
How to validate the phone number in the form field to be in this format: XXX-XXX-XXXX
Thank you in advance.

icon

Best answer by Mishraji 18 May 2021, 00:18

View original

1 reply

Userlevel 4
Badge +18

Add a custom validation to match the following regex:
/[0-9]{3}-[0-9]{3}-[0-9]{4}$/

Leave a Reply