Conditional fields

The Conditional fields block in Greyd Forms allows you to create dynamic form behavior by conditionally displaying or hiding content based on user input. This block serves as a wrapper for other form blocks. Any content placed inside it will appear or disappear live on the frontend, depending on the form values entered by the user.

Screenshot of Conditional fields block as wrapper after insertion with button to add blocks inside.

Settings

Screenshot of the Settings tab of Conditional fields block, explained in the following paragraphs.

Within the block settings, you can define how the conditions are evaluated. The Relation of the condition option lets you choose between and or or. Selecting and means all defined conditions must be met for the content to be shown. Choosing or allows the content to be shown if at least one of the conditions is met.

In the Conditions section, you can add multiple conditions. Each condition requires selecting a field which is looked at and a rule that defines the logic. The available condition types include, the words in brackets are the internally used values:

  • Has the value (is): checks if the field has the exact value specified.
  • Contains the value (has): checks if the field contains the specified value.
  • Has not the value (is_not): checks if the field does not have the specified value.
  • Is empty (empty): checks if the field is empty.
  • Is not empty (not_empty): checks if the field is not empty.
  • Greater (>) (greater): checks if the field value is greater than a given number.
  • Greater than or equal to (>=) (greater_equal): checks if the field value is greater than or equal to a given number.
  • Smaller (<) (smaller): checks if the field value is smaller than a given number.
  • Less than or equal to (<=) (smaller_equal): checks if the field value is smaller than or equal to a given number.

The block also supports Animations. In the Advanced section, you can find settings for additional CSS classes and toggles to hide the block per breakpoint.

Styles

Screenshot of the Styles tab of Conditional fields block, explained in the following paragraphs.

Under Styles, there’s a separate section for Animations, which is specific to how the showing and hiding works when the set conditions match or don’t match. You can choose between four Types of animation:

  • Slide
  • Fade in and out
  • Slide and fade
  • None

By default, Hide at start is activated, so any fields inside the block are hidden when loading the form. Additionally, you can decide to Leave containers open after submission, which means that the form doesn’t reset to it’s original setup but persists the show/hide settings even after submission of the form.

Video

You are currently viewing a placeholder content from Vimeo. To access the actual content, click the button below. Please note that doing so will share data with third-party providers.

More Information

Last updated: