Skip Navigation

[Resolved] Autocomplete address field

This support ticket is created 7 years, 1 month 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 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 7 replies, has 3 voices.

Last updated by jamesR-13 7 years, 1 month ago.

Assisted by: Shane.

Author
Posts
#572547

Hi is it possible to add autocomplete to an address field using Toolset (Types and Cred)? If so could you point me in the right direction of your documentation

Thanks

#572616

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Stewart,

Thank you for contacting our support forum.

If you use our toolset maps plugin it comes with a custom field that you can setup in Types called address which allows you to add an address to a field. It uses the google maps API to autocomplete the addresses.

The toolset maps plugin can be downloaded from the link below.
https://toolset.com/account/downloads/

Please let me know if this helps.
Thanks,
Shane

#572642

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Looking forward to hearing from you soon.

#573650
map.PNG
back.PNG

Hi Shane I implemented this but I don't think it was quite what I meant (or i'm doing it wrong!)

I created a field using the Google Maps Address custom field in Types and then generated a CRED form using the auto wizard. There are 2 issues

1) There is a large blank box on my front end CRED form. Filling in the field populates the map, which is unnecessary. I am just trying to get the address of the person filling in my form. Is there way of removing the map?

2) I need them to fill in their complete address including country, postcode etc. Is there a way to add validation to the custom address field?

So I guess is there any way of doing both these things using the Maps Plugin or is that not really what it is intended for - bearing in mind I am not trying to plot things on a map, i'm just trying to make the address field autocomplete as a usability improvement for my form

Thanks again

#573798

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Stewart,

In response to your questions.
1. You are able to hide the map using some css. The reason why the map is empty is because there isn't any information in the address field as yet.

2. Since their is an autocomplete on the field based on google then all the information should be populated when the user fills in the information. A custom validation would require that you do string comparisons using regular expressions, but this will expect that the address will be in a certain format. So the field won't validate if there are 2 addresses but they are formatted differently or some addresses have a little more information than others.

I wouldn't impose a validation on an address since there would be so many variables to account for.

Please let me know what you think.
Thanks,
Shane

#574040

Thanks Shane - that makes sense! The only problem is that the address field doesn't force them to enter a zip code or postcode, which we need, as it is a form I am creating to send orders to people. So we need to ensure they are filling in the full address. Is there a way to enforce just this?

Thanks

#574117

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi Stewart,

What you can do is to place the zip code as a separate field entirely and make that field required.

This will ensure that the zip code is added to the form submitted.

Thanks,
Shane

#631241

What if we take the entire address in separate fields then combine them together using javascript for the full address field?