Custom validation is not working
-
Hello Sir,
I used CF7 wordpress plugin and one of my client wants to change date field validation. I tried it out by function but it is not wordking.
add_filter('wpcf7_validate_date', 'custom_date_validation_message', 10, 2); function custom_date_validation_message($result, $tag) { $tag_name = $tag->name; if ($result['valid'] === false && $tag_name === 'dates') { $result->invalidate($tag, 'Please enter a valid date in the format DD/MM/YYYY.'); } return $result; }
My field name is “dates” and input field type is “date”.
Please help me
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Custom validation is not working’ is closed to new replies.