Skip to content
Log in

Account Address Form - Liquid Form Reference

On this page

Usage

```liquid

{% form “account-address”, path: address.path, method: “patch”, address: address %} {% assign label = form.fields[“label”] %}

{% assign country = form.fields[“country”] %}

{% endform %} ```

The account-address form creates or updates an address book entry for the signed-in customer. It backs the new and edit surfaces on the account dashboard’s addresses section. The address book is scoped per contact, so the form always writes against the signed-in contact and never against a colleague on the same account.

Property Value
Form Name account-address
Category Accounts

Parameters

Parameter Required Description
path Yes The path the form posts to. Use address.path with method: "patch" for an edit, or current_store.addresses_path to create. Do not post to address.edit_path or current_store.new_address_path, which are the pages that display the forms.
method No The HTTP method. Defaults to POST. Pass "patch" for an update.
address No A CustomerAddress entry whose values pre-fill the fields. Omit it when creating.

Any other tag option is passed through as an HTML attribute on the <form> element.

Fields

Reach each field as form.fields["name"] inside the block:

Field Notes
label Optional. When it is left empty, the record is named after a one-line summary of the address
address_lines A collection of one or more lines
city  
state  
postal_code  
country Always required
is_default_shipping Boolean
is_default_billing Boolean

Which of city, state, postal_code and the street lines are required depends on the country, using the same per-country rules the checkout applies.

Form Object

Inside the form block, you can access the form object which provides:

  • form.fields["name"] — Each field above, carrying its name and value
  • form.errors — Any validation errors after submission

Was this article helpful?

Was this article helpful?