Skip Navigation

[Resolved] taxonomy

This support ticket is created 4 years, 11 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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 3 replies, has 2 voices.

Last updated by Waqar 4 years, 11 months ago.

Assisted by: Waqar.

Author
Posts
#1466993

Can I make a taxonomy term required?

Also can I select a taxonomy term to show as default?

#1468815

Hi,

Thank you for contacting us and I'd be happy to assist.

If you're referring to the term fields for the taxonomies, you'll find the option to make them required, in that field group's edit screen:
https://toolset.com/documentation/user-guides/term-fields/

Also, are you planning to show the default taxonomy term in view's search filter or in Toolset Forms? If you could share more specific information and/or screenshot about the context of this question, I'll be in a better position to guide you accordingly.

regards,
Waqar

#1475181

Hello Waqar,

Thanks for your help, and the document you sent was also helpful.

In being specific about my question,

I created a form for our office admin where they can review our members and apply the categories/taxonomies that apply to each member.
However, to minimize time when the admin reviews each member, as the complete form is open, I wanted to apply a required category/taxonomy to be checked before submitting the form, so the admin does not have to again review the same member. If the category could be formatted as "required", it would be of a big help when I make the views, for I am using those categories/taxonomies as filters for my views, but if one is forgotten to be check off, it will throw the system off if the admin forget few important ones. (I dont want to make all categories required, just a few that are very important.).

The second question, when as specific form is open, I wanted to have one or two category to be checked automatically lets say three colors in the category to choose: black, white, blue. However black is is always pre-selected/pre-checked as default, and the admin needs to choose a different option if there is a need for the blue color to be checked.
Then my question is , how can I make a category to display a default checked off selection in a form?

Thanks

#1476187

Thank you for sharing further details.

1. To add a validation rule and error message, so that it is not possible to submit a front-end form without selecting any term from a taxonomy field, you can use "cred_form_validate" hook:
https://toolset.com/documentation/programmer-reference/cred-api/#cred_form_validate

You'll find the code snippet examples for your exact same requirement, in these replies:
https://toolset.com/forums/topic/how-to-make-taxonomies-required-fields/#post-672324
https://toolset.com/forums/topic/how-to-make-a-taxonomy-and-image-upload-field-required/#post-1224077

2. To automatically check specific term checkboxes, when the form loads, you can use custom jquery script.

Here is a useful guide on this topic:
hidden link

I hope this helps and please let me know if you need any further assistance around this.

regards,
Waqar