Google Places suggestions in Gravity Forms
Address Autocomplete via Google for Gravity Forms Pro adds address autocomplete to Gravity Forms through the Google Places API. Visitors can receive place suggestions while entering information in an address field or a single field, helping forms collect location details through an assisted input experience.
The plugin is designed for forms that need address-related information, including locations, cities, addresses, and other selectable place types. Pro features extend the basic autocomplete workflow with additional controls for restricting results, displaying map information, and working with place data.
Autocomplete and field support
- Enable Google Places autocomplete for an address field.
- Use autocomplete in an address field or single field.
- Restrict results by country.
- Choose from three place-type restrictions.
- Support place types such as schools, restaurants, cities, and addresses.
- Use the location button.
- Work with the Place API, including the new Place API.
Country restriction can help narrow suggestions for forms intended for a particular market. Place-type restriction provides another way to focus results on the kinds of locations relevant to the form, such as a city, restaurant, school, or address.
Maps, distance, and place information
The Pro edition includes a map field for forms where a map-based location experience is useful. It also provides distance calculation and place details, giving the form workflow additional location-related capabilities beyond text suggestions.
These tools can support forms that collect or compare locations, request place information, or guide users toward a more specific result. The location button provides another interaction for working with the user’s location within the supported form experience.
Configuration workflow
Begin by opening the Gravity Forms menu and going to Autocomplete API settings. Enter the Google Maps API key and save the settings. Next, create or edit a form and add or edit an address field. In the field settings, enable Enable Autocomplete with Google Places API, then save the form.
After this setup, the selected field can provide Google place suggestions. Additional Pro controls can then be configured according to the form’s needs, including country restriction, place type, map, distance, and place details options.
Practical applications
- Collect addresses through guided Google place suggestions.
- Limit suggestions to selected countries.
- Focus a form on particular types of places.
- Add map-based location input to a Gravity Forms workflow.
- Use distance calculation or place details for location-oriented forms.
Requirements
The source lists PHP 7.4 or higher and Gravity Forms 2.9.0 or higher as requirements. Before configuring the integration, ensure the form environment meets these requirements and that the Google Maps API key has been entered in the plugin’s Autocomplete API settings.