CRED lets you set conditional display for sections in forms. This means that some sections can display or hide, based on the values of custom fields and taxonomy inputs.

View Video »

Before you add conditional display, make sure that the inputs that will determine these conditional displays are inserted into the form.

If you are building your form manually, without the help of CRED’s auto-generation feature, please note that for cred_show_group shortcode to work, you need to add the following before your form’s end tag:

[cred_field field='form_messages' value='']

Step 1 – Select the form section to make conditional

Use the mouse or keyboard to select which area in the form to make conditional.

CRED Form - Select Part Of The Form You Want To Display Conditionally
CRED Form – Select Part Of The Form You Want To Display Conditionally

You can choose anything, starting with a single input and continuing with the entire form.

Step 2 – Adding the condition for display

After selecting the section of the form that you want to make conditional, click on Add Generic Field –> Conditional Group.

CRED Forms - Insert Conditional
CRED Forms – Insert Conditional

CRED Forms - Conditional Display Dialog
CRED Forms – Conditional Display Dialog

Add conditions using the dialog. You can include any number of display conditions and connect them with AND or OR conditions. For fine tuning, you may also enter a textual argument for the conditional display.

The display conditions GUI lets you include any number of fields and connect them with AND or OR logic. For more complex display logic, you can write custom expressions.

Display conditions may also be nested. You can select a section inside an already-conditional section and add another condition to it.

Step 3 – CRED wraps the form section with cred-show-group

Look at the form source.

Form sections with conditional display
Form sections with conditional display

You’ll see that CRED has wrapped the section that you selected with a cred-show-group shortcode. That shortcode includes the condition for displaying the section.