Home › Forums › Front-end Issues › Assemble Google Map location based on address fields › Reply To: Assemble Google Map location based on address fields
I have some examples of adding custom JS to update fields based on other fields, but not anything for your exact needs. Getting the value from a text field should be fairly easy.
When targeting fields you need to use something like
$('[data-key="field_0123456789"] input')
for a text field, field names are not used in the input fields when editing, only the keys. The name of the field is in a data attribute, but it’s always easier to use field keys.
Updating the google maps field, I have not done this yet. I would start by figuring out what field in the map field needs to be updated and then I’d look for the action to trigger the map field to do it’s thing. This could be as simple as triggering a change event on the input field where you insert the value.
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!
✨ You can now install ACF PRO with Composer, eliminating the need for third-party installers. Get the details and instructions here. https://t.co/ebEfp60Pwj
— Advanced Custom Fields (@wp_acf) February 2, 2023
© 2023 Advanced Custom Fields.
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.