Skip Navigation

[Resolved] Preselect specific term on post form

This support ticket is created 4 years, 1 month 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
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Tagged: 

This topic contains 1 reply, has 2 voices.

Last updated by Christian Cox 4 years, 1 month ago.

Assisted by: Christian Cox.

Author
Posts
#1878483

We just discovered another problem and the client would like, that the parent category is checked by default. Could you help me with that?
hidden link

hidden link

#1878545

Hello, there's not an easy way to preselect taxonomy term checkbox option(s) like this in the Form builder or using the Forms API. The "value" attribute does not apply to taxonomy fields, as stated in the documentation: https://toolset.com/documentation/programmer-reference/forms/cred-shortcodes/#cred_field

The field filtering API only applies to custom fields:
https://toolset.com/documentation/programmer-reference/cred-api/#cred_filter_field_before_add_to_form

A custom solution using JavaScript to add a checked attribute to a specific checkbox input can be seen in an older ticket here: https://toolset.com/forums/topic/pre-fill-value-for-checkboxes-select-lists-and-radio-buttons/
You might be able to customize that for your needs.