bookmark_borderAddress

The Address field makes it quick and easy to capture address information on a form. This field provides a pre-formatted area for two street addresses, city, state/province, zip/postal code, and a drop down for country selection.

## Field Settings

General

Address General

  • Field Label
    Enter the label of the form field. This is the field title the user will see when filling out the form.

  • Description
    Enter the description for the form field. This will be displayed to the user and provide some direction on how the field should be filled out or selected.

  • Address Type
    Select the type of address you would like to use.

  • Address Fields
    Within this section, you can use the toggle switches to enable or disable specific data within the address field.

  • Default Country/State/Province
    Based on your selection within the Address Type, options will dynamically populate for the default country, state, or province. They can be selected here if you would like these to default to a specific location.

  • Rules
    These properties set rules for how the data should be handled.

    • Required
      A required field will prevent the form from being submitted if it is not filled out or selected.

Appearance

Address Appearance

  • Placeholders
    Placeholders may be used to place text within the field to give the user more information about the expected input.

  • Description Placement
    Allows you to override the default placement. Descriptions may be placed either above or below the field.

  • Sub-Label Placement
    Similar to the Description Placement option, but instead applies to the sub-label.

  • Custom Validation Message
    If you would like to override the default error validation for a field, enter it here. This message will be displayed if there is an error with this field when the user submits the form.

  • Custom CSS Class
    Enter the CSS class name you would like to use in order to override the default styles for this field.

Advanced

Address Advanced

  • Admin Field Label
    Enter the admin label of the form field. Entering a value in this field will override the Field Label when displayed in the Gravity Forms administration tool.

  • Default Values
    If you would like any of the fields to default to a specific value, you may enter that value here.

  • Display option to use the values submitted in different field
    This may be used to populate the field from the information on another field. This is useful in cases such as shipping/billing address fields, where they may be the same information.

    • Option Label
      This determines the text that will be displayed next to the checkbox listed next to the field, which allows copying of the data. An example of this would be: Copy address from billing address.

    • Source Field
      Within this option, you will determine the field that will provide the data to this field.

    • Activated by default
      This option is used to activate population of the field based on another, by default.

  • Visibility
    Select the visibility for this field. Field visibility set to Everyone will be visible by the user submitting the form. Form field visibility set to Admin Only will only be visible within the Gravity Forms administration tool. Setting a field to Admin Only is useful for creating fields that can be used to set a status or priority level on submitted entries.

  • Allow field to be populated dynamically
    Check this option to enable data to be passed to the form and pre-populate this field dynamically. Data can be passed via Query Strings, Shortcode and/or Hooks.

  • Enable Conditional Logic
    Create rules to dynamically display or hide this field based on values from another field. Remember, to use conditional logic, you will need to create a drop down, checkbox or multiple choice field.

Address Type

  • International

    Address Type International

    The International address type is the default address type and supports most address formats internationally.

  • United States

    Address Type United States

    The United States address type is formatted specifically for address within the United States.

  • Canadian

    Address Type Canadian

    The Canadian address type is formatted specifically for addresses within Canadian.

Custom Address Type

Do you need to support an address type that is not compatible with any of the predefined options? No worries! You can add support for a new address type easily by using the gform_address_types filter. This filter can also be used to update the format of the predefined options as well.

Conditional Logic Support

Starting with Gravity Forms 2.0 you can configure conditional logic rules on other fields based on the values of the Address field inputs.

CSS Targeting Examples

Address Field Targeting Examples

Extending the Address Field

Looking for information about what properties the Address field uses in the Field Object, what format it’s value is stored in the Entry Object and how you can access it, or what hooks/filters it includes then take a look at the GF_Field_Address article.

Merge Tags

Usage

Display the Street Address.

{Field Name:2.1}

Display the Address Line 2.

{Field Name:2.2}

Display the City.

{Field Name:2.3}

Display the State / Province.

{Field Name:2.4}

Display the ZIP / Postal Code.

{Field Name:2.5}

Display the Country.

{Field Name:2.6}

Modifiers

This merge tag does not have any modifiers.