Skip Navigation

[Resolved] How not to select taxonomy (leave blank) in front end

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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+01:00)

Tagged: 

This topic contains 2 replies, has 2 voices.

Last updated by Pat 3 years, 8 months ago.

Assisted by: Nigel.

Author
Posts
#1255499

Pat

Hello,

I have created a Cred including a taxonomy. I'm displaying it as a select field.

The issue I have is that even if the field is not mandatory, the first option is always validated (pre populated).
For some cases, I don't need to have any option chosen, but that seems impossible !

I have made some research and found this : https://toolset.com/forums/topic/populate-a-preset-vale-for-category-taxonomy-for-front-end-submission-form/#post-1234008
but I need to place the select ID and cannot find it in the html code delivered by the Cred (in fact, I can find some but it's changing at each page reload, so not usable for this !).

Could you give me the way to have this ?

Regards
Pat

#1255595

That's right when displaying Custom Taxonomies with the Forms in a select format, the first and selected option is the first term in the taxonomy.
But that's just the native behaviour of Taxonomies in general, WordPress' "Categories" also will always be set to "Uncategorized" if nothing else is chosen, and that is, in fact, a Term.

The easiest solution would be to create such "nulled" term in your taxonomy.
Then it could be used the same way as the WordPress native Categories where you also cannot unselect the always selected "Uncategorized" term (even in the backend).

I am however also aware, that in the backend, Custom Taxonomies leave you that freedom to not select any term for.
That's not possible in Forms, I think it needs a new Feature.
Currently, you could do this with Custom Code only:
https://toolset.com/forums/topic/drop-down-list-of-taxonomies-first-choice/#post-611270
https://toolset.com/forums/topic/default-value-select-taxonomy-term-in-cred/

New Features can be usually submitted at https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/, but I'll first check with my colleagues what they think about asking the Developers adding this as an attribute to the shortcode in Forms anyway.

I'll update you here as soon as I have news.

#1725017

Pat

My issue is resolved now. Thank you!

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.