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

  • I’ve used the checkValidity() JS function.

    
    $('#form-part-1 button.input-submit').click(function(e) {
       e.preventDefault();
       var valid = true;
       $('#form-part-1').find('input').each(function() {
          if (valid === true) {
             valid = this.checkValidity();
          }
       });
       if (valid === true) {
          $('.acf-error-message').remove();
          $('#form-part-2').show();
          $('#form-part-1').slideUp();
       }
    });
    

    This isn’t perfect, and it don’t use acf/validate_value or acf/validate_save_post, but I can’t manage to use them with the ACF Javascript API