Home › Forums › Front-end Issues › Frontend Custom Validation for acf_form › Reply To: Frontend Custom Validation for acf_form
I just did a test and everything is working as expected using this code
add_filter('acf/validate_value/key=field_64ba92e423e65', 'validate_email_field', 20, 4);
function validate_email_field( $valid, $value, $field, $input ) {
if (!$valid) {
return $valid;
}
if( email_exists( $value ) ) {
$valid = 'email exists';
}
return $valid;
}
You must have something else that is interfering, as I said in my original response, something that is breaking the ajax response. Either another plugin or some code in the theme.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.