Login

Vectors

Vector: form

The {{ form }} vector ties to the Forms section in the control panel. It is the vector that is used to contain the form fields set up for one of your forms. The vector name will be the vector you set for the desired form. You don't have to enter a form action or method - they are handled automatically by the Vectoran engine. You also don't need to write any <form> or </form> HTML tags - the Vectoran engine takes care of these also. All forms submit via POST to a form listener page that handles the data according to how the form is configured.

The {{ form }} vector is a multipart vector meaning that you are required to include an {{ endform }} vector with it. If the {{ endform }} vector is not included, a parser error is thrown.

See the {{ form_field }} vector for more details on rendering individual form fields within the form.

Note: if any form fields added to the form in the control panel are ommitted from within the {{ form }} vector, then they will automatically be appended to the end of the form - wherever the {{ endform }} vector appears.

Options

The {{ form }} vector supports two options: id and class. This are the same as the HTML id and class attributes that can appear in a <form> tag. Specifying either of these options will automatically put their value in the <form> tag.

The destination option defines the vector name of the page that the form should redirect to upon successful submission. If this option is omitted, then the system will redirect back to the page that contains the form.

Examples

{{ form: contact_us | id="contact_us_form" | destination="contact_us_success" }}
  Name: {{ form_field: name }}
  Email: {{ form_field: email }}
  Comments: {{ form_field: comments }}
{{ endform }}


The above example creates a form for the form with the vector "contact_us". The <form> tag would render as:

<form id="contact_us_form">