Conditions and Validators

Conditions and Validators

Form fields can be conditional and may have one or more validators. It is important for template developers working with form fields to undersetand how these are configured and accessible when creating templates.

{{ condition }}

Represents the condition that should be used to show and hide form fields.

Properties of {{ condition }} objects
Name Type Description
is_valid Boolean Will be true when the condition exists and is valid
type String The type of condition to use. Each type corresponds to a different condition object which has its own additional properties
output String {JSON object}

Related

{{ form_field }}

{{ label_field }}

Should be used to display a text label inside a form.

object

May be any object, including simple, complex and list objects. In some cases may even include symbols and null.

{{ submit_field }}

Should be used to display a submit button inside a form.

{{ checkboxlist_field }}

Should be used to display a list of checkboxes inside a form.

{{ textarea_field }}

Should be used to display a textarea field inside a form.

string

Can be any text, from the empty string ("") to the full HTML output of the template. When used alone in a conditional, all strings evaluates as true - even if they are empty or a value such as "0" or "false".

{{ date_field }}

Should be used to display a date field inside a form.

{{ select_field }}

Should be used to display a select list inside a form.

{{ button_field }}

Should be used to display a custom button inside a form.

{{ captcha_field }}

Should be used to display a captcha inside a form.

{{ file_field }}

Should be used to display a file upload field inside a form.

{{ radio_field }}

Should be used to display a radio field inside a form.

{{ text_field }}

Should be used to display a text field inside a form.

{{ group_field }}

Should be used to display a group of fields inside a form.

{{ checkbox_field }}

Should be used to display a checkbox field inside a form.

{{ validators }}

The tests that should be applied to validate that the value entered in a field is valid before submitting the form.

Properties of {{ validators }} objects
Name Type Description
is_valid Boolean True if there are one or more validators to apply
output String {JSON object}

Related

{{ checkboxlist_field }}

Should be used to display a list of checkboxes inside a form.

{{ textarea_field }}

Should be used to display a textarea field inside a form.

{{ date_field }}

Should be used to display a date field inside a form.

{{ select_field }}

Should be used to display a select list inside a form.

{{ file_field }}

Should be used to display a file upload field inside a form.

{{ text_field }}

Should be used to display a text field inside a form.