Forms lets you set the conditional display for individual fields and sections in forms. This means that some elements of the form can be displayed or hidden, based on the values of custom fields and taxonomy inputs.
Each of the fields in your form can be displayed based on a condition. This can be controlled directly from Types. You can set a condition for your field in the following way:
- Create or edit a Field Group on the Toolset -> Custom Fields page.
- Expand (edit) the field that you want to display conditionally.
- Click the Set condition(s) button.
In a dialog box that opens up click the Add condition button, set one or more conditions for your field and click the Apply button.
To add a Conditional group to your forms, use the following steps:
- Drag-and-drop a Conditional group element from the Extra elements panel into the forms.
- Move the Conditional group to a correct location within the form.
- Drag-and-drop one or more fields into the Conditional group.
You can add any number of fields into the Conditional group.
Click to expand the options for the inserted Conditional group and add your conditions.
You can include any number of conditions and connect them with AND or OR conditions. For fine tuning, you may also enter a textual argument for the conditional display. For more complex display logic, you can write custom expressions.
You can create nested conditions but not using the drag-and-drop editor. To create nested conditionals, switch to the Expert mode and enter the nested conditions manually.