[address_lookup_form_field]

The shortcode creates an address lookup field powered by the Google Maps API, which can be used within [search_form].


Product


Shortcode Attributes

There are a number of shortcode attributes available which you can use to customize the output.

General

  1. label – Field label displayed above the input.
    • Options: Any text value.
  2. placeholder – Placeholder text for input fields.
    • Default: Enter Address.
    • Options: Any text value.
  3. id – HTML ID attribute for the input field
    • Default: address-lookup.
    • Options: Any text value. Specify one only.
  4. classes – Additional CSS classes for the field.
    • Options: Any text value.

Location

  1. country_code – Restricts search to a specific country.
    • Default: au.
    • Options: Any country code value.
  2. search_type – Limits search results to specific types
    • Options: geocode, address, establishment, regions, cities.
      • Example: establishment type will return business results, while address will return geocoding results with precise address.

Data Handling

  1. data – Used to specify the address component to get from the lookup field.
    • Default: lat,lng.
    • Options: lat, lng, post_code, country, state, city, suburb, street. Use commas , to separate.
  2. data_format – Format for address components.
    • Default: short.
    • Options: short, long. Specify one only.
  3. autosubmit – Whether to auto-submit form on selection.
    • Default: on.
    • Options: on, of. Specify one only.

Example Usage

[search_form pageid=123]
   [address_lookup_form_field label="Business Location" placeholder="Start typing your address..." search_type="cities"]
[/search_form]

Results

Example:
This example displays a search form (linked to page ID 123) with an address lookup field specifically designed to search for cities, labeled “Business Location” with a custom placeholder text “Start typing your address…”.
Uses Google Places Autocomplete service.