The form object

The form object is used within the form tag. It contains attributes of its parent form.

form.address1

Returns the first address line associated with the address. Exclusive to form tags with the "address" parameter.

form.address2

Returns the second address line associated with the address, if it exists. Exclusive to form tags with the "address" parameter.

form.author

Returns the name of the author of the blog article comment. Exclusive to form tags with the "article" parameter.

form.body

Returns the content of the blog article comment. Exclusive to form tags with the "article" parameter.

form.city

Returns the city associated with the address. Exclusive to form tags with the "address" parameter.

form.company

Returns the company name associated with the address, if it exists. Exclusive to form tags with the "address" parameter.

form.country

Returns the country associated with the address. Exclusive to form tags with the "address" parameter.

form.email

Returns the email of the blog article comment's author. Exclusive to form tags with the "article" parameter.

form.errors

Returns an array of strings if the form was not submitted successfully. The strings returned depend on which fields are required for the form type. Possible values are:

  • author: for required name fields, such as blog comments
  • body: for text content of messages, such as a contact form
  • email: for required email fields
  • password: for required password fields
  • form: used as a general error in cases where a more specific error cannot be provided

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

form messages and translated fields

You can loop through the