Conditional layouts (and the fields placed in them, including action fields) are only output on your form if their Condition Function returns true. Use them to include or exclude other fields based on that function.
The Condition Function of this field is executed server-side as the form page is being rendered. It can access the values of fields or variables in your form that appear before it in your form (either on previous pages, or fields that are above the conditional layout on the current page).
If the Condition Function returns false, the fields in the layout will not be present on the page and cannot be interacted with in any way. This differs from fields that have simply been hidden. Hidden fields are still present on the page (but invisible) and so they can be interacted with.
There will always be a field value for the container field itself, available using
The Show property affects when the function is executed. In "always" mode, the function will run when the form page displays, and again when generating the summary/read-only view (eg an email). Make sure your function doesn't rely on form variables, as these are not available in summary/read-only modes (see Read-Only Forms and Views).
There's an example of the conditional field in the Conditional Layout Fields article.
Properties
| Label | Description | Type Name |
|---|---|---|
| Label | The label for the container, only used for read only views | LABEL |
| Show | Determines when the container conditional function should be executed and any contained fields output. By default, the conditional function will always be executed and the contained fields will be output if the function returns true. Change this setting if the conditional function should only be executed in read only mode (eg in emails/PDFs) or standard mode (eg when the form is rendered for input). The following options are available: Always - The conditional function will always be executed Form - The function will only be executed when the page HTML is being rendered on the site, the field won't ever appear in emails Summary (Email) - The function will only be executed when the page HTML is rendered in read only mode, without controls eg in emails. The field won't ever appear on the site | SHOW |
| Condition Function | A JavaScript function that is executed server-side to determine if the fields within the container should be displayed. This function uses the following format: function (helper) {It should return true to display the fields. The values of other stored field values can be accessed via the helper library supplied as the first argument. Remember that if you are running this function when generating emails or other read-only views, form variables (and their values) won't be available to it. Note that this function is only executed if the conditions for showing the container are met. For example if the container 'show' property is only defined for the Summary (email) output this function will not be executed when rendering the form normally | CONDFUNCTION |
| Default | This property sets the default behaviour if no conditional function is defined. Normally a conditional function is defined and this determines when any contained fields will be output | DEFAULT |
| Documentation | Add documentation to your field to help explain any complex functionality to future users. You might include information on what the field does and how it relates to other fields on the form. Notes added here are only ever visible in the Forms Designer, they can be searched for, viewed and downloaded from the action panel. See Common Field Properties for an example | DOCUMENTATION |
