Support

Account

Home Forums Front-end Issues How to validate fields on the same page when using acf_form() Reply To: How to validate fields on the same page when using acf_form()

  • So this took quite a lot of effort to figure out. Turns out acf_form_head() it needs to be before any output but if you do it too soon it causes all sorts of errors. I thought using WP’s init hook would work, and it did for the most part, but it would break AJAX validation (hence the middle page).

    I tried a few different hooks but it seems like template_include is the one that fixed the issue.

    If you’re getting a 500 error page when an field is blank but the rest seems to work properly, try changing where your acf_form_head() function is called.