Skip Navigation

[Resolved] Conditional Fields in form based on Selected Taxonomy

This support ticket is created 6 years, 9 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 2 replies, has 2 voices.

Last updated by Nigel 6 years, 9 months ago.

Assisted by: Nigel.

Author
Posts
#627545

J S

Tell us what you are trying to do?

I only want certain fields to display in a form if a certain Custom Taxonomy category is selected from a select box.

I'm using the following code to try to implement this but the form is not showing the Audio or Video fields when the Video & Audio Podcast Category is selected. The slug for the custom category is 'submission-type' and the slug for the specific category to show the fields is 'audio-visual'. I've also tried to enter the slug 'audio-visual' below in place of 'Video & Audio Podcasts'.

[cred_show_group if="($(submission-type) eq 'Video & Audio Podcasts' )" mode='fade-slide']

<div class="form-group">
<label>Video Link</label>
[cred_field field='video-link' post='submissions' value='' urlparam='' class='form-control' output='bootstrap']
</div>

<div class="form-group">
<label>Audio Link</label>
[cred_field field='audio-link' post='submissions' value='' urlparam='' class='form-control' output='bootstrap']
</div>
[/cred_show_group]

Can you offer any advice as to how to format the expression to make this work?

The form can be seen at this link: hidden link

thanks

#627676

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi there

I tested this locally so that I could confirm what advice to give to you and I couldn't get it to work myself.

I note that I had to insert the condition for a taxonomy manually (only custom fields could be used within the GUI), even though our documentation describes using either custom fields or taxonomies for this.

I have had to escalate this so that my colleagues can check and identify whether there is a bug, or perhaps we are both doing it wrong.

I'll keep you posted.

#627678

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

I see you filed two tickets about the same issue and solved it yourself in the other thread.

Closing here.