Locator Button Field
Introduction
The Locator Button Field lets a visitor request their current location and sends the result to a connected Geocoder Field. Use it to offer a convenient “find me” action without requiring the visitor to enter an address first.
Available in: Starter, Pro, and Agency.
The field uses browser HTML5 geolocation or a configured IP-location provider. It does not require Google's Geolocation API. Browser location normally requires HTTPS and the visitor's permission.
Configuring the Locator Button Field
- Geocoder Field: select the Geocoder that should receive the detected location.
- Button Label: customize the text displayed on the button.
- IP Address Locator: when a global IP provider is configured, choose whether IP lookup is disabled, used as the default method, or used as a fallback when browser location fails.
- Location Found Message: enter the message shown after the location is found, or leave it empty to disable the message.
- Hide Location Failed Message: hide the default failure message when the form provides its own instructions or fallback.
IP-based location is generally less precise than device location and may represent the visitor's network or service-provider location rather than their exact position.
Setting Up and Using the Locator Button Field
- Add a Geocoder Field to the form.
- Add a Locator Button Field and select that Geocoder.
- Customize the button label and messages.
- If needed, configure an IP-location provider under Ninja Forms > Settings > Geolocation, then select the desired IP behavior on the field.
- Optionally add Address, Coordinates, or Map Fields connected to the same Geocoder.
- Save the form and test it over HTTPS with browser permission both allowed and denied.
The Locator Button waits for a visitor to click it. Form-level Auto Locator is a separate feature that can request a location automatically for one or more selected Geocoder Fields.
Saved Value and Outputs
The Locator Button is an interaction control and stores no independent submission value. The connected Geocoder Field stores the detected location, including its coordinates and any resolved address data.
Use the connected Geocoder and its dynamic values or merge-tag parts when notifications, calculations, or integrations need the resulting location.
Troubleshooting
The browser does not ask for location permission
Confirm that the page uses HTTPS, the browser has not already blocked location access, and the form is not embedded in a context that prevents geolocation permission.
The button finds a location but other fields remain empty
Confirm that the Locator Button and the visible Address, Coordinates, or Map Fields are connected to the same Geocoder Field.
The IP option is unavailable or does not run
Configure and enable a supported IP-location provider in the global Geolocation settings, then review the field's IP Address Locator setting. IP options appear only when a global provider is available.
The detected location is not precise
Browser and device accuracy varies, and IP lookup is approximate. Enable High Accuracy Location Mode globally when appropriate and test on the devices used by the intended visitors.