Conditional logic is used to hide form elements until specific form conditions are met.
Condition logic can be applied to any element type and is controlled by a switch in the element details. These conditions can apply to the radio button and the select checkbox, number, and calculation elements.
For example, conditional logic can be set up so that some headings will only be shown when certain conditions are met. When the radio button 'Radio Button 1' is checked the heading 'I only want to show when Radio Button 1 is checked' will be displayed on the form.
Looking at the 3 elements 'Radio Button', 'Select', and 'Checkbox,' when nothing is checked there are no headings being displayed. However, if the radio button is checked the conditions for the heading to display are met.
If all the elements are checked, all the conditions are met and all the headings are displayed on the form.
Conditional logic on user inputs is simple: an input can either have a value or not have a value.
In the example below the Heading element will remain hidden until the text box above has something typed into it.
This can be used in conjunction with the Summary element to add further context to the Summaries Elements.
Multiple Conditional Logic Rules
After you have created a single conditional logic rule, additional rules can be added as well. When you add a second rule to the conditional logic of an element, a new option will appear: the Match ALL and the Match ANY buttons.
- Match ALL: The Match ALL button will ensure that ALL of the rules are met before the element will display.
- Match ANY: The Match ANY button will display the element if ANY of the rules are met.
For example, here, there are 2 Heading elements '1 or A' and '2 and B'. Based on their names, '1 or A' will display if '1' OR if 'A' is checked, and '2 and B' will only display when '2' AND 'B' are both checked.
Conditional Logic on Numbers and Calculations
Conditional logic can also be placed on number and calculation elements. This will allow you to conditionally show an element based on the value in another element.
The conditions you can place against number and calculation elements include:
- not equal to
- greater than
- greater than or equal to
- less than
- less than or equal to
You are able to add as many conditional logic rules as desired, but they will follow these same logical rules.
If you have any questions, please contact support, and we'll help in any way that we can.