Skip Navigation

[Resolved] Use a GEOLOCATION field in an EDIT POST form

This thread is resolved. Here is a description of the problem and solution.

Problem:

On my EDIT POST form, I have geolocation field, when the user edits their post, I need to allow them to lookup their address using this field, just like they can when creating a post.

Solution:

It is possible to setup a custom address field in Toolset post form, for example, you can try these:

https://toolset.com/forums/topic/use-a-geolocation-field-in-an-edit-post-form/#post-1245640

Relevant Documentation:

https://toolset.com/documentation/customizing-sites-using-php/functions/#address

This support ticket is created 5 years, 6 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 8 replies, has 2 voices.

Last updated by leeF-2 5 years, 6 months ago.

Assisted by: Luo Yang.

Author
Posts
#1245528

Tell us what you are trying to do? On my EDIT POST form, I have geolocation field, when the user edits their post, I need to allow them to lookup their address using this field, just like they can when creating a post.

Is there any documentation that you are following? Have not found any.

Is there a similar example that we can see? Not certain.

What is the link to your site? hidden link

-----
I use the Gravity Forms product to create the CPT for my visitor's clubs. On that form there is a geolocation field that does a Google address lookup. When my users visit the EDIT POST LINK to edit a post, that geolocation field is there, but does not function as a geolocation field. Is there any way to add a field that has this same functionality? Also, I set separate "Address 1", "Address 2", "City", "State", "Zip" and "Country" fields based on the information in this field (in Gravity Forms). Is there similar functionality in Toolset Forms?

#1245640
address.JPG

Hello,

It is possible to setup a custom address field in Toolset post form, for example, you can try these:
1) Install Toolset Maps plugin in your website, you can download it here:
https://toolset.com/account/downloads/

2) Setup google map API key
https://toolset.com/documentation/user-guides/display-on-google-maps/#api-key

3) Create a custom address field by follow our document:
https://toolset.com/documentation/user-guides/how-address-fields-work-in-cred-forms/

4) Then put above address field into your post form, users will be able to input their address and use their own location, see screenshot address.JPG

But there isn't similar feature for these:
separate "Address 1", "Address 2", "City", "State", "Zip" and "Country" fields based on the information in this field

But you can display the address value with different format using Types shortcode, see our document:
https://toolset.com/documentation/customizing-sites-using-php/functions/#address
format:
Use the literals FIELD_ADDRESS, FIELD_LATITUDE and FIELD_LONGITUDE in the format to output the address

#1245678
screenshot2.jpg
screenshot1.jpg

Hello Luo,

Unfortunately, while I have the MAPS plugin and it is active (screenshot1.jpg), I do not see an ADDRESS field option to add to my form (screenshot2.jpg). Am I missing something?

#1245687

You will need to setup your own google map API keys here:
Dashboard-> Toolset-> Settings-> Maps, in option "Google Map API key"

See our document:
https://toolset.com/documentation/user-guides/display-on-google-maps/creating-a-google-maps-api-key/

#1245693
screenshot1.jpg

I've already done that.

#1245699

Please make sure you have create a custom address field for it, see our document:
https://toolset.com/documentation/user-guides/using-custom-fields/

If you need more assistance for it, please provide a test site with the same problem, also point out the problem form URL and page URL, I can setup a demo for you

#1245979

So, I created a new custom field, and have added it to the form. How do I activate it as an address lookup field?

#1246206
address4.JPG

Yes, it is possible to input some keyword into the address field and lookup related address, see screenshot address4.JPG

#1246551

Figured out what I was doing wrong. Just didn't add the right type to the form. Works great now.

Thanks!