Support

Account

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") );
          }
       }
    );