Skip to main content

Address field

What it does​

An Address field asks for a postal address in separate boxes under one label. You find it in the builder's left panel, in the Text Input group, and add it by dragging it onto the form, as described in Adding fields and sections.

A new Address field has five parts, each with its own small label, called a sub-label: Street address on a row of its own, then City and State / Province side by side, then Postal / ZIP code and Country. You can add a second street line, Address line 2.

Address field: Street address, then City and State / Province, then Postal / ZIP code and Country; United States chosen, California picked from the state list

Country is a list of the countries your store allows. When the chosen country has a list of states in Magento, such as the United States, Canada or Germany, State / Province becomes a list of that country's states. For other countries it stays a box the visitor types into.

The answer is saved as one address. The submission page, the Inbox column and emails show it on several lines, like a postal address: the street lines, then city, state and postal code, then the country's name.

When to use​

  • Use Address for a delivery, pickup or billing address you want to read as one address. The answer stays with the submission: it doesn't change the customer's saved addresses.
  • Use a Country field alone when you only need the country, or want to base an email condition on it. Add a State field when you also need the region as a separate answer.

Settings​

Go to Content → WebForms → Manage Forms, click the form's name, then click Form Builder. Click the field on the form. Its settings show in the right panel, on the tabs General and Appearance. You'll change these settings most often:

  • Address fields (General tab) lists the six parts. Each part has a switch that shows or hides it, a Sublabel (the small label the visitor sees), a Placeholder (a hint inside the empty box) and its own Required switch. On a new field, Street address, City and Country are marked Required; State / Province and Postal / ZIP code aren't.
  • Required (General tab, under Basic) makes the visitor fill in every part that is marked Required. When the field itself isn't required, the visitor can leave the whole address empty. But once they start filling it in, the parts marked Required must be filled in too. The builder says so under each part's Required switch while the field isn't required: "Required once any part is filled in".
  • Default Country chooses a country in advance, for example the country you deliver to most. Its list shows every country Magento knows, so pick one your store allows: visitors only see allowed countries.
  • Pre-fill with Customer Data fills the empty parts with the default billing address of the signed-in customer, including the country and the state, also when Default Country is set. The customer can still change them.
  • Sublabel Position (Appearance tab) puts the sub-labels below the boxes or above them. A new field places them below; a field that came over from an earlier version keeps them above.

The countries in the list come from your store's Allow Countries setting, under Stores → Configuration → General → General → Country Options. That setting is shared with checkout, so change it there only if your store sells to those countries too.

The table below lists every setting. Visitors see a change after you click Publish Changes in the builder's top bar.

All settings of this field
Setting Where in the panel Values Translatable
Enable Field General → Basic On or off No
Label (required) General → Basic Text Yes
Field Code General → Basic Text No
Required General → Basic On or off No
Required Error Message General → Basic Text Yes
Help Text General → Basic Formatted text Yes
Tooltip General → Basic Formatted text Yes
Pre-fill with Customer Data General → Field Settings On or off No
Address fields General → Field Settings Edited in the panel No
Default Country General → Field Settings A list of 249 options No
Hide in Submissions General → Submission Display On or off No
Allow in Staff Email Subject General → Submission Display On or off No
Submission Label General → Submission Display Text Yes
Personal Data General → Privacy By field type — Personal data, Not personal, Personal data No
Desktop Appearance → Layout Width: Full (1/1), Half (1/2), Third (1/3), Quarter (1/4), Fifth (1/5), Sixth (1/6), 2/3, 3/4, 2/5, 3/5, 4/5, 5/6; New row: on or off No
Tablet Appearance → Layout Width: Full (1/1), Half (1/2), Third (1/3), Quarter (1/4), Fifth (1/5), Sixth (1/6), 2/3, 3/4, 2/5, 3/5, 4/5, 5/6; New row: on or off No
Mobile Appearance → Layout Width: Full (1/1), Half (1/2), Third (1/3), Quarter (1/4), Fifth (1/5), Sixth (1/6), 2/3, 3/4, 2/5, 3/5, 4/5, 5/6; New row: on or off No
Show Label Appearance → Style On or off No
Help Text Position Appearance → Style Below input, Above input No
Sublabel Position Appearance → Style Above input, Below input No
Container Classes Appearance → CSS Text No
Input Classes Appearance → CSS Text No
Custom Attributes Appearance → Advanced Text No
Inline Style Appearance → Advanced Text No

Validation​

Which parts must be filled in depends on the field's own Required setting:

  • The field is Required: each part marked Required must be filled in before the form is sent.
  • The field isn't required: the visitor can send the form with the address left empty. If they fill in any part, for example only City, each part marked Required must be filled in as well.

Only what the visitor types or picks counts as filled in: a country chosen in advance by Default Country doesn't, so an optional address with a default country can still be left empty. An address filled in by Pre-fill with Customer Data does count: if the customer's address lacks a part marked Required, such as the postal code, they must add it before sending.

The visitor sees one message under the field for each empty part, with that part's sub-label, for example "Street address is required" and "City is required". The same messages show on Luma, Hyvä and Breeze. In this version, Required Error Message doesn't change these messages.

The country must be one your store allows, and a state from a list must belong to the chosen country. The field has no Validation tab: length and pattern checks aren't available for an address.

Logic​

  • Start a rule: no. An Address field can't start one. Its Logic tab appears only once a rule shows or hides it, and lists that rule.
  • Show or hide this field: yes. Start the rule on another field that has a Logic tab, such as a Select, and choose this field as the one to show or hide. See Show or hide fields and sections.
  • Email conditions: the field is listed with Is, Is Not, Contains, Starts With and Ends With. They compare against the address as one line of text, the way the submission page shows it, and ignore letter case. Use Contains with one word, such as a city. To route by country, add a separate Country field and use it in the condition. See Recipients and conditions.

Limits​

  • By default, an address counts as personal data. Through the Management API and AI assistants the answer is masked. See Personal data masking.
  • State names come from Magento's own list and are shown as Magento stores them, for example the German states in German.

Troubleshooting​

  • A country is missing from the list. The list shows the countries your store allows. Check Allow Countries under Stores → Configuration → General → General → Country Options.
  • The state is a text box instead of a list. Magento has no list of states for the chosen country, so the visitor types it.

What's next​

Applies to WebForms 4Last reviewed October 14, 2026