Support

Account

Home Forums Front-end Issues Submit frontend form even if validation fails Reply To: Submit frontend form even if validation fails

  • Before I start, let me say that I don’t know anything about the functions that you mention and that this is not a solution but a direction for you to look in.

    I don’t think that you can stop ACF from validating fields and showing errors and make it allow the submission of the form when there are errors. The first step will be that you need to remove all of the settings for fields that require fields, you simply will not be able to use the validation.

    The next step will be for you to create your own ac/pre_save_post filter https://www.advancedcustomfields.com/resources/acf-pre_save_post/, or you can probably use the acf/save_post filter. This depends on what you want to do. If you want to save a post as a draft or published based on validation then I’d probably go with pre_save_post, but the other can be used just as easily as you and always update the post status based on validation as well.

    Anyway, if I understand what acf_add_validation_errro() does, in your filter you would do all the validation yourself and use this function set all errors for all fields yourself.

    Hope that helps you get to where you’re going.