Can I make a taxonomy term required?
Also can I select a taxonomy term to show as default?
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
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
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