Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Contact form 7 telephone number verification

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.

like image 536
Kiran Dash Avatar asked Feb 16 '16 07:02

Kiran Dash


People also ask

How do I add a phone number to a contact form 7 in WordPress?

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.

What is Tel in Contact form 7?

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.


1 Answers

Try this one definitely it will work as per contact form 7 documentation.

[number* your-telephone minlength:10 maxlength:140 placeholder "Telephone number"] 
like image 80
VaqasUddin Avatar answered Nov 08 '22 00:11

VaqasUddin