Skip to main content

form

Information about a form created by a form tag.

Properties

The first address line associated with the address.

This property is exclusive to the customer_address form.

The second address line associated with the address.

This property is exclusive to the customer_address form.

The name of the author of the article comment.

This property is exclusive to the new_comment form.

The content of the contact submission or article comment.

This property is exclusive to the contact and new_comment forms.

The city associated with the address.

This property is exclusive to the customer_address form.

The company associated with the address.

This property is exclusive to the customer_address form.

The country associated with the address.

This property is exclusive to the customer_address form.

The email associated with the form.

This property is exclusive to the following forms:

Any errors from the form.

If there are no errors, then nil is returned.

Tip

You can apply the default_errors filter to form.errors to output default error messages without having to loop through the array.

The first name associated with the customer or address.

This property is exclusive to the create_customer and customer_address forms.

The ID of the form.

The last name associated with the customer or address.

This property is exclusive to the create_customer and customer_address forms.

The personalized message intended for the recipient.

This property is exclusive to the product form.

The nickname of the gift card recipient.

This property is exclusive to the product form.

Anchor to
password_needed

Returns true.

This property is exclusive to the customer_login form.

The phone number associated with the address.

This property is exclusive to the customer_address form.

Anchor to
posted_successfully?

Returns true if the form was submitted successfully. Returns false if there were errors.

Note

The customer_address form always returns true.

The province associated with the address.

This property is exclusive to the customer_address form.

Anchor to
set_as_default_checkbox

Renders an HTML checkbox that can submit the address as the customer's default address.

This property is exclusive to the customer_address form.

The zip or postal code associated with the address.

This property is exclusive to the customer_address form.

{
"address1": "12 Phoenix Feather Alley",
"address2": "1",
"author": null,
"body": null,
"city": "Calgary",
"company": null,
"country": "Canada",
"email": null,
"errors": null,
"first_name": "Cornelius",
"id": "new",
"last_name": "Potionmaker",
"password_needed?": false,
"phone": "44 131 496 0905",
"posted_successfully?": true,
"province": "Alberta",
"set_as_default_checkbox": "<input type='checkbox' id='address_default_address_new' name='address[default]' value='1'>",
"zip": "T1X 0L4"
}
Was this section helpful?