I have a frontend form for a Google Map field that I am calling like so:
‘form’ => false,
‘post_id’ => ‘user_’ . $user_id,
‘fields’ => array(‘field_5632a9d568942’),
It is part of a much bigger form. I rely on the hidden inputs that the Google Map field creates to get the address, lat, and lng. It’s absolutely perfect for my needs.
My issue is that when I submit the bigger form that the field is a part of (which is actually overridden in JS with preventDefault(), and instead handled with AJAX), the Google Map field triggers a form submit of its own, and the page refreshes and the URL is appended with Google Map ACF data.
I removed the <form> element by passing false in the args, hoping that would fix the issue but it does not. No matter what I do, the Google Map field always insists on triggering its own form submission, even without a <form> element.
Is there any way I can disable this? All I want is for the Google Map field to simply exist on the page, so that I can handle gathering the values from the hidden inputs myself using my own JS.
Thanks a bunch.