Home › Forums › Front-end Issues › acf_form_head and google map form inside a modal › Reply To: acf_form_head and google map form inside a modal
Thanks again for your interest John!
Actually, I found my way through this problem and sharing here, in case it helps anyone.
Since I wanted this map to be set globally from the header, then it would require the
acf_form_head() to be always loaded.
It took some effort, but I ended up with this solution:
– Created a separate page
– Added the google map form and styled it to stretch and occupy the whole screen
– Hid all other elements (header, footer, etc)
– Loaded the above page with jquery as an iframe and styled the iframe itself to look like a modal
– After the form submission I look for the $_GET[‘updated’] and if true, I load an inline script to remove the modal
This way, I don’t need to leave my current page, nor do I have to lead the
acf_form_head() where not needed.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We’re reaching out to our multilingual users to ask for help in translating ACF 6.1. Help make sure the latest features are available in your language here: https://t.co/TkEc2Exd6U— Advanced Custom Fields (@wp_acf) May 22, 2023
© 2023 Advanced Custom Fields.