Skip Navigation

[Resolved] Conditional display based on repeating field group select field value

This thread is resolved. Here is a description of the problem and solution.

Problem: I am trying to use conditionals in a Form but they don't seem to be working. I would like to show and hide some elements based on the selection in a field.

Solution: Be sure to use Forms Conditional Groups, not Views Conditional HTML. Forms Conditional Groups can be accessed in the "Add generic fields" dialog, and are designed to respond to Form field selections.

Relevant Documentation: https://wp-types.com/documentation/user-guides/conditional-display-for-form-inputs/

This support ticket is created 6 years, 5 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Tagged: 

This topic contains 1 reply, has 2 voices.

Last updated by Christian Cox 6 years, 5 months ago.

Assisted by: Christian Cox.

Author
Posts
#923432

I am trying to:

Get something to display on my repeating field group form based on the value of one of the select fields in my repeating field group.

Link to a page where the issue can be seen:

hidden link

I expected to see:

A field display based on the select field value

Instead, I got:

Nothing displaying

Is there any reason why conditional display does not work on repeating field group fields in a repeating field group form that is displayed on a page showing the post that contains the repeating field group? I believe this is as per the documentation.

#923686

Hi, there are two types of conditionals. Conditional HTML in a View looks like this:

[wpv-conditional if="( [wpv-post-id] eq '1' )"]
Something here
[/wpv-conditional]

That type of conditional will not respond to the selections in a Form. It's designed to work in a View or Content Template outside of Forms, with existing posts. Instead, you can use Forms Conditional Groups by clicking the "Add Generic Fields" button above the Form editor panel. These conditions will respond to the selections made in the current Form. They look like this:

[cred_show_group if="($(fieldslug) eq  '1' )"  mode='fade-slide']
Something here
[/cred_show_group]

More information about Conditional Groups in Forms here:
https://wp-types.com/documentation/user-guides/conditional-display-for-form-inputs/

If you're using the first type, try recreating your conditional HTML as Conditional Groups. If you're already using Conditional Groups, please copy + paste all the code from your Form editor here for me to review.