Home / Documentation / Address Autocomplete / Capture Latitude and Longitude with Address Autocomplete

Capture Latitude and Longitude with Address Autocomplete

Address Autocomplete Premium can capture the latitude and longitude coordinates of a selected address and populate them into form fields. This is useful for store locators, mapping, distance calculations, or any scenario where you need geographic coordinates.

How to set it up

In your instance’s data population settings, add a new field row for each coordinate:

  • Selector: The CSS selector of the form field (e.g., a hidden input)
  • Data: Use {lat} for latitude or {lng} for longitude

Unlike other data fields, latitude and longitude do not use :short_name or :long_name — just {lat} and {lng}.

Example

If your form has hidden fields for coordinates:

<input type="hidden" id="my-latitude" name="latitude" />
<input type="hidden" id="my-longitude" name="longitude" />

You would add two data population rows:

Selector Data
#my-latitude {lat}
#my-longitude {lng}

When a user selects an address, the coordinates are automatically populated into those fields and submitted with the form.

This is a premium-only feature.