Tell us what you are trying to do?
------------------------------------------------
I have created a cred edit form with a select box that shows a set of options from a taxonomy, the 'Select' drop down box on the cred edit form never take into account which option has been saved in the post it just displays a list of what is in the taxonomy and does the set any item as 'selected' even though it is saved in the database.
Example
------------
If I have a bunch of taxamonies in a cred 'new post' form with a the select box showing the taxonomy, items for example.... options 1,2,3,4> I
f I select and save the option as '4' this saves into the database OK
When I come to edit the post, the select box is now displaying the first option and not the option that is saved when I created the post.
this is the select box in the cred form code i am using
[cred_field field='drop-zone' display='select' single_select="true" output='bootstrap']
I cant find any documentation how to tell the select box to set the selected item in the drop down to the option that has been set on post creation.
What is the link to your site?
hidden link
Many thanks!
I tested this locally and this is how it works:
1. If a Hierarchical Taxonomy is set to select single, single select true, then we obviously defy the purpose of a hierarchical taxonomy
2. But, we can do it and we will see a select dropdown populated with all existing terms, and if we choose one, the post will be updated with that term.
3. When you load a Post that has several terms set, it will obviously display just one, and that is why I mean that the purpose is defeated, it is not the correct information anymore eventually.
4. In any case, any term you save on the post is correctly reflected on the CRED form and each term updated will remove all old terms and add the new term only.
So far, I saw no issues.
But then, eventually, I miss a step or detail.
We do also have similar issues as you desccribe with checkboxes, maybe I misunderstood you, and you meant those:
https://toolset.com/forums/topic/cred-form-not-ticking-checkboxes/
Please let me know if I miss something to above steps.
Ah! so does that mean I should not use a taxonomy, all I need is a drop down select box with a single selection only. Can this be done with a taxonomy, and on an edit for it show me which selection has been saved in the post?
all I need is a drop down select box with a single selection only
Then I suggest a single Field (Select) to be created in Toolset Types first
https://toolset.com/documentation/customizing-sites-using-php/functions/#select
This will give you what you need here.
Yes I will do that instead, I a used taxonomy to make it more simple for a third party to add extra items, but using the standard select box will probably be easier in the long term to manipulate the data.
As always great support many thanks Beda!