Skip Navigation

[Resolved] Taxonomy dropdown in Form does not affect visibility of fields in conditional group

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

Problem: I have a Form that includes a taxonomy select field. I have created a conditional group that should respond to that taxonomy selection, but it doesn't work. If I change the taxonomy field to a checkboxes group, it works.

Solution: There is currently a problem where flat taxonomies do not work well with conditional groups in Forms. The workaround is to transform flat taxonomies into hierarchical taxonomies, and use the term ID in your conditional code.

[cred_show_group if="( $(job-type) eq '12345' )" mode="slide"]
...
[/cred_show_group]

Relevant Documentation:
https://toolset.com/documentation/user-guides/cred-conditional-display-engine/

This support ticket is created 5 years, 2 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 4 replies, has 2 voices.

Last updated by cristianR-3 5 years, 2 months ago.

Assisted by: Christian Cox.

Author
Posts
#1195543

I am trying to: I have a taxonomy dropdown that should hide or show certain fields on a form

Link to a page where the issue can be seen: Local development

I expected to see: The pertinent fields for that Taxonomy.

Instead, I got: When I set the dropdown, nothing shows. It works if I use Checkboxes, but I only want the user to select one choice.

#1195666

Hi, I'll try to help. Please copy + paste the code from your Form here for me to review.

#1195682

This is the pulldown field that would dictate what would show or be hidden. It is a Taxonomy selection so I can't access it from the "Add Conditional Groups" UI. Like I mentioned, it works as expected with I use checkboxes. But when I attempt to use a pulldown field it no longer works.

<div class="form-group">
<label>Job type<br><span class= "spanish">Tipo de trabajo</span></label>
[cred_field field='job-type' force_type='taxonomy' output='bootstrap' display='select' single_select='true']
</div>

This is the code that is supposed to set the display group.
[cred_show_group if="( $(job-type) eq 'Nannies' )" mode="slide"]
...
[/cred_show_group]

Beforehand, thanks for your time and assistance.

#1196141

Okay after doing some research it appears there is an issue with flat taxonomies and conditional groups. Is job-type a flat taxonomy or a hierarchical taxonomy? If it's flat, is it possible to convert it into a hierarchical taxonomy? With a hierarchical taxonomy, you should be able to use the term ID instead of the term slug in your comparison:

[cred_show_group if="( $(job-type) eq '12345' )" mode="slide"]
...
[/cred_show_group]

The term ID can be found by editing the term in wp-admin. In the URL you can find the tag_ID parameter. That's the number you should place in the conditional.

#1196232

My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.