Conditional Logic

Overview

Ultimate Member provides conditional logic within the form builder which allows you to configure your registration, login or profile form to show or hide fields based on user selections. Conditional logic can be applied to a field when creating a new field or editing an exisiting or pre-defined field.

Adding conditional logic to a field

To add conditional logic to a field you need to open up an individual field’s options by adding a new field from field modal or clicking the edit icon to edit an exisiting field. Near the bottom of the field modal you will see text that says: “Add conditional fields support”. Clicking on this text to will open the conditional logic options.

Show or hide

The basic idea with conditional logic is that you show or hide a field based on the user’s selection of another field. If you select show, the field will only appear on the form once the conditions are met. If you select hide, the field will disappear from the field once the conditions are met.

Field selection

The second input required for conditional logic is to select the field which will trigger the conditional logic to show/hide. To do this simply click the dropdown and select the name of the field from the list. Only fields that have been added to the form will show in this dropdown.

Action

The third input required for conditional logic is to select the action that will trigger the conditional logic. There are several actions to choose from:

  • Empty– If empty is selected this means that this field will show/hide if the selected field is empty (e.g has no user input)
  • Not Empty– If not empty is selected this means that this field will show/hide if the selected field is not empty (e.g the field has user input)
  • Equals to– If equals to is selected this means that this field will show/hide if the selected field is equals to the text or number you set in the value input (e.g if you set the value input to be London and the user selects London from country list then the field will show/hide)
  • Not equals– If emtpy is selected this means that this field will show/hide if the selected field is not equals to the text or number you set in the value input (e.g if you set the value input to be London and the user selects New York from country list then the field will show/hide)
  • Greater than– If greater than is selected this means that this field will show/hide if the selected field is greater than the number you set in the value input (e.g has no user input)
  • Less than– If less than is selected this means that this field will show/hide if the selected field is greater than the number you set in the value input (e.g has no user input)

Value

The final input required for conditional logic is to set the value. This involves entering the text or number that will trigger the field to show/hide. Below is what you can enter into the value input for each action type:

  • Empty– The empty action requires no value input and should be left with the default 0
  • Not Empty– The not empty action also requires no value input and should be left with the default 0
  • Equals to– The equals to action can contain either text or number. If entering text make sure the text matches exactly with the what the user selects (e.g if the user selects Male from gender field make sure you set the value as Male and not male).
  • Not equals– The not equals action can contain either text or number. If entering text make sure the text matches exactly with the what the user selects (e.g if the user selects Male from gender field make sure you set the value as Male and not male).
  • Greater than– The greater than action should only be used for numbers and not for text.
  • Less than– The less than action should only be used for numbers and not for text.

Adding multiple conditions

It is possible to add more than one condition to each field. You are able to add up to five conditions per each field. This means you have more flexibility over what conditions will make a field show/hide on the form.