Documentation

Address Field

Last modified: February 26, 2025

Introduction

The WPForms Address Field in WPForms Geolocation integrates geolocation functionalities to enhance address-related inputs. This field provides real-time address suggestions, a locator button for retrieving the user’s current location, and advanced controls to restrict autocomplete results by proximity or area bounds. The Address Field seamlessly integrates with the Geocoder Field and other geolocation fields to provide dynamic geolocation experiences.

Note: this documentation focuses on the geolocation-specific options provided by the WPForms Geolocation plugin. In addition to these settings, the field includes all standard WPForms options, such as labels, descriptions, conditional logic, and more, which can be configured the same way as any other WPForms field.

Configuring the WPForms Address Field

The following sections outline the configuration options available for the Address Field. These settings define how geolocation functionality operates within your forms.

1. Geocoder Field

Select the Geocoder Field to synchronize with this WPForms Address Field, ensuring seamless location data synchronization.

Note: Ensure a Geocoder Field has been added to your form. For setup instructions, refer to the Geocoder Field Documentation.


2. Locator Button

Enable a button within the WPForms Address Field to retrieve the user’s current location and configure related settings. By default, the plugin uses the browser's HTML5 Geolocation API feature to retrieve the user’s location. However, it is also possible to enable IP address-based location as a fallback or alternative.

Note:The HTML5 Geolocation feature requires user consent to access location via browser permissions.

Enable Locator Button

Check this option to enable the locator button (Default: Disabled).

IP Address Locator

Define how the IP address will be utilized to retrieve location data:

  • Disabled: Do not use the IP address (Default).
  • Default: Use the IP address as the primary locator.
  • Fallback: Use the IP address only if the browser fails to retrieve the location.

Location Found Message

Customize the message displayed when the user’s location is successfully retrieved (Example: Your location has been detected successfully!).

Hide Location Failed Message

Enable this option to hide the error message if the browser or IP-based geolocation fails to retrieve the location (Default: Disabled).


3. Address Autocomplete

Activate real-time address suggestions using the Google Places API and configure related features.

Enable Address Autocomplete

Check this option to activate autocomplete suggestions for address fields.

Force Address Selection

Restrict users to selecting an address from autocomplete suggestions, preventing manual entry.

Force Address Selection Message

Customize the message shown when users attempt to manually enter an address instead of selecting from suggestions (Example: Please select an address from the suggestions).

Results Type

Specify the types of results to display in the autocomplete suggestions:

  • All types: Show all available suggestions (Default).
  • Geocode: Geographic coordinates for precise location.
  • Address: Full address details, including street and building information.
  • Establishment: Suggestions for businesses and points of interest.
  • Regions: Broader geographic areas, such as states or provinces.
  • Cities: City-level results only.

Learn more about how address autocomplete works by visiting the Google Places API Documentation.

Restrict by Country

Limit suggestions to specific countries. You can select up to five countries.


4. Autocomplete Bounds Restrictions

Configure restrictions to refine autocomplete results based on proximity, area bounds, or the user's location.

Restriction Usage

Choose the type of restriction:

  • Disable: Disable this feature (Default).
  • Proximity: Limit results to a radius around a central point.
  • Area Bounds: Restrict results to a defined geographic area.
  • Page Locator: Refine results based on the user's detected location.

Proximity Restriction

Configure latitude, longitude, and radius for proximity restriction:

  • Latitude: Enter the central latitude (Example: 26.423277).
  • Longitude: Enter the central longitude (Example: -82.021776).
  • Radius: Enter the radius in meters (Example: 100).

Area Bounds Restriction

Define the geographic bounds for restricting results:

  • Southwest Point: Enter the coordinates of the southwest corner (Example: 26.423277,-82.137132).
  • Northeast Point: Enter the coordinates of the northeast corner (Example: 26.4724595,-82.021776).

Restrict to Defined Area

By default, autocomplete results are prioritized within the defined bounds but may include results outside the area. Check this option to strictly limit autocomplete results to the specified bounds (Default: Disabled).


Setting Up and Using the WPForms Address Field

Follow these steps to configure and use the Address Field effectively:

  1. Add the Address Field: Insert it into your form using the WPForms builder.
  2. Sync with a Geocoder Field: Synchronize the Address Field with a Geocoder Field to enable dynamic updates.
  3. Set Up Field Options: Configure the Address Field as detailed in the Configuring the Address Field section above.
  4. Test Your Configuration: Preview the form on different devices and browsers to ensure all Address Field features function as expected.
menu-circle