Tell us what you are trying to do?
I have a post type with 100 custom fields. I would like the user to be able to select from a taxonomy for the "type," and then depending on the type selected, show only certain custom fields. I was told to use conditionals on the form, but I still cannot get this to work.
Is there any documentation that you are following?
https://toolset.com/course-lesson/conditional-display-for-form-inputs/
Is there a similar example that we can see?
I can demonstrate clearly the functionality I'm expecting by using ACF. But I don't have a live link to that.
What is the link to your site?
hidden link
Thank you!
Dan Williford
Hi Dan,
Thank you for contacting us and I'd be happy to assist.
To add a taxonomy based conditional display in the Toolset Form, you can follow these steps:
1. Please add a conditional group in your form and select the option to edit the condition manually:
( screenshot: hidden link )
2. If the taxonomy field is set to the "select or dropdown" type field, you'll compare the condition with the target term's ID.
Suppose that your taxonomy slug is "type" and the ID of the term that you'd like to show this conditional field group for is "10":
( screenshot: hidden link )
3. The only difference in case the taxonomy field is set to the "checkbox" type field would be that you'll use the target term's name/title and not the ID:
Similarly, you can keep adding the conditional field groups for the other taxonomy terms and include the specific custom fields within.
I hope this helps and please let me know if you need any further assistance around this.
regards,
Waqar
Hello Waqar,
Thank you so much for your help!
I followed these steps but I still wasn't able to get it to work. For one thing, I can only locate the "slug" for the taxonomy term and not the ID. But using the slug with checkboxes still didn't work--nothing changed after the checkbox was selected.
To put the question differently: What is the best way to do a form that uses a taxonomy selection as the basis for conditional fields?
Thank you!
Dan
Thanks for the update.
You can locate the ID of a taxonomy term using these steps:
1. Please go to the taxonomy management page and click the edit link of the desired term.
( example screenshot: hidden link )
2. In the URL of the term edit page, you'll see the term's ID in the parameter "tag_ID".
( example screenshot: hidden link )
> But using the slug with checkboxes still didn't work--nothing changed after the checkbox was selected.
- As mentioned in point 3 of my last reply, in case of a checkboxes type taxonomy field, you'll need to use the target term's name/title ( and not the slug ).
If it still doesn't work, you're welcome to share temporary admin login details, along with the page where this form can be seen.
Note: Your next reply will be private and please make a complete backup copy, before sharing the access details.