Comment on page
Address lookup/auto complete
How to lookup/autocomplete an address within your WordPress form and populating form input fields with the address data.
In order to enable the Address Auto Complete function you will have to edit your Text field and select the
Address auto complete (google places)option from the dropdown.
Now make sure you enable the feature by checking Enable address auto complete.
- Google Places API Web Service
It's possible to restrict results based on countries (up to a maximum of 5).
fr,nl,dewould restrict results for France, Netherlands and Germany
us,pr,vi,gu,mpwould restrict your results to places within the United States and its unincorporated organized territories.', 'super-forms' ),
You can define what type of results you wish to return, you can choose one of the below types (leave blank to return all types):
geocode: return only geocoding results, rather than business results. Generally, you use this request to disambiguate results where the location specified may be indeterminate.
address: return only geocoding results with a precise address. Generally, you use this request when you know the user will be looking for a fully specified address.
establishment: return only business results.
(regions): return any result matching the following types: locality, sublocality, postal_code, country, administrative_area_level_1, administrative_area_level_2
(cities): type collection instructs the Places service to return results that match locality or administrative_area_level_3
It's also possible to automatically populate other text fields with data based on the selected place. For instance, you could add fields named
zipcode. You can then map the text field where the user searches for a place/address so that it automatically fills out these individual fields.