Answer the question
In order to leave comments, you need to log in
How can I use hooks in functions.php to make Contact form 7 substitute my class to the form when checking fields??
Currently, Contact Form 7 submits a class to the form .invalid
when trying to Submit with blank required fields. How to make hooks to substitute a class for example .was-validated
?
This is how you can simply add a class to the form:
function wpcf7_form_class_attr_onvalidate( $class ) {
$class .= ' was-validated';
return $class;
}
.is-invalid
inputs that received an error during validation?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question