DEV Community

Muhammad Shoaib
Muhammad Shoaib

Posted on

Custom Validatation For Phone Number Field Contact Form 7 WordPress

By using this snippet you can validate the Telephone field in your form. If you want to validate some specific pattren like US nummber you can use this regular expression to validate the pattren

preg_match(/^[0-9]{3}-[0-9]{3}-[0-9]{4}$/)

Top comments (0)