Home › Forums › Front-end Issues › Trigger verification of the form without submitting it › Reply To: Trigger verification of the form without submitting it
Well, I’m embarrassed. After reading the ACF source code I’ve found a display_errors
function.
To display the errors messages you just need to add it into the callback of the POST request, like this :
$.post(
my_ajax_obj.ajax_url, data,
function(result) {
errors = result.data.errors
if (errors === 0) {
// Code for success
} else {
acf.validation.display_errors( errors, $("form.acf-form") );
}
}
);
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.