Add conditional logic to your forms
You can trigger specific actions based on the values visitors provide when they fill in a form.
Show/hide an element based on visitors' values
You can show or hide an element depending on the values visitors enter in forms. For example, if a visitor select a specific checkbox, a text field may appear for visitors to explain their choice in more detail.
Use case example
Suppose you create a select box and want to display a second one based on the visitor's selected option.
In the first select box's settings section, indicate two options:
- Latest products
- Blog updates
For visitors who choose Latest products, add a second select box (hidden by default) that includes:
- All products
- Clothes
- Shoes
In the Widget Studio's Events section, you must create a specific event to display the second select box. To create this event:
- Navigate to the Events section of the Widget Studio.
- Select Form > By element form value in the next screen.
- Select your first select box element.
- Choose the value you wish to associate with this event (for example, Latest products).
- Navigate to the Add action menu.
- Select Elements.
- Choose the second select box you created.
The result of this event's configuration is as follows:
Here's the impact of this conditional logic at the widget display level: