Home Forums Front-end Issues Frontend Custom Validation for acf_form Reply To: Frontend Custom Validation for acf_form

  • I’m sorry but I never thought it was related to my validation code and more so with acf_form_head() — the former was included to show that I wasn’t doing anything silly that would be causing the issue.

    That being said, I seem to have solved it. I have a custom admin area that needs the use of ACF so I include acf_form_head() on that page. What I didn’t realize was that my code to add it was being called during AJAX calls on the frontend (because admin-ajax.php is considering part of the backend) so it would validate the submission.

    I wrapped it around a wp_doing_ajax() condition and it solved it. I’m frustrated with myself because I’m sure I grepped my plugin for acf_form_head() in my plugin and I’m sure it didn’t come up — clearly a user error there.

    I know I’m not supposed to do what I’m doing but I couldn’t figure out a way to add ACF to an options page that isn’t created with ACF but I digress and I’ve taken enough of your time!

    Thank you so much for your help and I apologize for wasting your time — just know that I’ve been working on this for three days and I posted here out of desperation.