Hello, I am trying to set the taxonomy in Cred submission form which can be the only single selection, because I want to query by taxonomy, but I just want users to pick only one within I have set it up. for example, I only want users to choose one location form New York, Los Angeles, Boston and so on I have added in the back-end, but don't want users to add more cities. so the original format of Cred form doesn't meet I need. what I should do
Thank you!
The follow-up, my question is how to set the taxonomy as a single selector in Cred submission form, the taxonomy will be as a Cred field. the options were preset in the backend. no question with view and search form. Thanks!
Hello,
It is possible to setup the taxonomy field as select field, for example:
you can edit the CRED form, in the form content, find and edit the CRED shortcode [cred_field], which is for rendering the taxonomy field, add attributes "display" and "single_select" into it, like this:
[cred_field display="select" single_select="true" ...]
More help:
https://toolset.com/documentation/user-guides/cred-shortcodes/#cred_field
display. Optional. Used by fields for Hierarchical Taxonomies (like Categories) to signify the mode of display (ie. “select” or “checkbox”).
single_select. Optional. Boolean. If the display=select argument is set, then single_select=true will only allow a single option to be selected (by default multiple options can be selected). Defaults to false.
Hi Luo
Thank you so much for the replay. I have tested few times, but it should be not working. please check the screenshot, Destination is a custom hierarchic taxonomy, I would like to make it as a selectable drop-down, and added display="select" single_select="true". but it isn't a dropdown yet. please help me check it thanks
This option only works for the Hierarchical Taxonomy, please try this:
Edit the custom taxonomy "destination", in section "Taxonomy type", choose option "Hierarchical", and test again.
It is working fine now. Thank you so much! 🙂
Oh, But I found a small flaw, I cannot set a placeholder, for example, before the user chooses the taxonomy, the default option should be No set. select_text='--- not set ---' placeholder='--- not set ---' are not working with that shortcode.
Yes, you are right, the attribute "select_text" and "placeholder" does not work for taxonomy field of CRED shortcode [cred_field].
So there isn't such a built-in feature within CRED form, if you agree, we can take it as a feature request.