Navigation überspringen

Conditional Display for Form Inputs in WordPress

Conditional output in Toolset forms lets you show or hide form sections based on the values of fields. It's useful for creating dynamic forms.

You can display or hide elements of the form based on the values of custom fields and taxonomy inputs.

To add a Conditional group to your forms, use the following steps:

  1. Drag-and-drop a Conditional group element from the Extra elements panel into the forms.
  2. Move the Conditional group to a correct location within the form.
  3. Drag-and-drop one or more fields into the Conditional group.
Toolset Form - Define the Part Of the Form You Want To Display Conditionally
Toolset Form – Define the Part Of the Form You Want To Display Conditionally

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.

Toolset Forms - Conditional Group Options

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 should avoid using conditions that use special characters like single quotes, double quotes, or dollar signs. Such conditions may fail to evaluate.

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.

Updated
November 16, 2020