Home › Forums › General Issues › acf_form Validation in Block › Reply To: acf_form Validation in Block
Thanks, John. I tried that but it didn’t seem to affect the Ajax validation, only the fields appearance. The JS solution is working well though so I’m going to run with that having now added in a check to see if the targeted for is being validated and ‘passing’ it if so:
acf.add_filter('validation_complete', function( json ){
var match = false,
val = "acf[field_123xyz]";
$.each( json.errors, function( index, value ){
if( value.input == val ) match = true;
} )
return match ? { valid: 1 } : json;
});
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.