Pages

Thursday, May 1, 2014

Contact Form 7 Create Custom validation for all fields - [resolved]

If you want to add custom validation for contact form 7 input fields than please write below code:

add_filter('wpcf7_validate_FIELDNAME','cf7_custom_form_validation', 10, 2); // wpcf7_validate_email or wpcf7_validate_email*

function cf7_custom_form_validation($result,$tag) {
    /*
        Here you can write your custom code for validation
    */
}

No comments: