I am trying to use the built in verification method for contact form 7 to verify a telephone number.
Contact form 7 markup:
<p>[number* your-telephone min:1000000000 max:9999999999 placeholder "Telephone number"] </p>
<p>[submit "submit"]</p>
So, what I am trying to do here is restrict phone number using the min and max properties of input type of number. But the problem here is that if I enter a telephone number say: 0402356584 then it is less than the min value but is still a phone number.
So, how can I set the min and max value to support all possible 10 digit telephone numbers?
Any other solution different from my approach is also most welcome. Because I have got a feeling that the verification can not be done using min and max attributes.
I also tried to edit the plugin files via functions.php file by using the code from a source but that did not work.
So, if any one has the perfect solution to validate telephone numbers on contact form 7 then please post your answers.
Upload the entire country-phone-field-contact-form-7 folder to the /wp-content/plugins/ directory. Kindly make sure 'contact form 7' plugin active before activate this plugin. Activate the plugin through the 'Plugins' menu in WordPress.
Email – Create a form tag for an email address. URL – Create a form tag for a URL. Tel – Create a form tag for a telephone number.
Try this one definitely it will work as per contact form 7 documentation.
[number* your-telephone minlength:10 maxlength:140 placeholder "Telephone number"]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With