Custom validation not working after update
-
Please help me with the following problem.
Our end user has to attach their CV as a file or write a short bio in textfield below. If both fields are empty, the form gets invalidated.Here is what used to be a working code up until your latest changes:
add_filter( 'wpcf7_validate', 'wpq_validate' ); function wpq_validate( $result ) { $form = WPCF7_Submission::get_instance(); $cv_file = $form->get_posted_data('cv_file'); $cv = $form->get_posted_data('cv_textfield'); if( empty($cv_file) && empty($cv) ) { $result->invalidate('cv_file', __( 'some message', 'theme' ) ); $result->invalidate('cv_textfield', __( 'some messsage', 'theme' ) ); } return $result; }I tried literally everything, but file tag is always null…
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘Custom validation not working after update’ is closed to new replies.