Field Validation not working | WordPress.org

[ad_1]

I have added a “length validation” to functions.php for that field. But why plugin’s core phone validation is not working?

Hello @spcspectre

This is not validation from the plugin. This option runs the default WooCommerce validation that checks if the entered value is a number (no matter how long the number is). Please note that the same effect will be when our plugin is not active – then the phone number like 2 will also be validated as correct.

If the validation is to check a specific format or length – then a custom validation is needed – as in the example below.
Example

It checks if the phone number has 9 or 10 characters.

I see.. Thanks for your reply..

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer