Login

Vectors

Vector: form_field

The {{ form_field }} vector generates the HTML for a the applicable input box in a form. The vector name is the name you assign to the field in the form in your control panel. If no field exists with that name, then a parser error is thrown. The engine automatically knows what type of field to generate based on your form configuration. For example, it may generate <input type="text"/> box or <select>.

Options

The options for the {{ form_field }} vector are analogous to the attributes on the corresponding form elements. For example, you can pass in an id, class or name.

Examples

{{ form_field: first_name | class="standard_text" }}
The above example creates a form field with the class "standard_text". If it was a text field, it would render:

    <input type="text" class="standard_text"/>

{{ form_field: first_name | value="Your name" }}
The above example creates a form field with the default value set to "Your name". If it was a text field, it would render:

    <input type="text" value="Your name"/>