Skip Navigation

[Resolved] Cred form for specific taxonomy

This support ticket is created 6 years, 5 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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 6 replies, has 2 voices.

Last updated by Ronen 6 years, 5 months ago.

Assisted by: Luo Yang.

Author
Posts
#951093

Hi,
I want to create a post submit form for specific taxonomy in my cpt, how can I do that?

#951198

Hello,

You can try below one of below two options:
1) specific the default value of taxonomy field, and hide it with some CSS codes
https://toolset.com/documentation/user-guides/cred-shortcodes/#cred_field
Argument "value": Preset value

2) no taxonomy field in the post form, after user submit the form, use CRED action hook "cred_save_data" to setup the taxonomy value
https://toolset.com/documentation/programmer-reference/cred-api/#cred_save_data

#951220

Hi,
i sow the two options you add, i not geting the checkbox of the taxonomy to be checked.
this is the field in the cred form: [cred_field field='bc_des' display='checkbox' value='2' output='bootstrap']
what ami i doing wrong?
BR
Ronen

#951286

Hi, i try also this:

jQuery(document).ready(function($) {

jQuery("select[name^='YOUR-SELECT-NAME'] option[value='OPTION-VALUE']").attr("selected","selected");

});
but the after i save thr form it show: $(document).ready(function($) {
$(\"select[name^=\'bc_des\'] option[value=\'לבן\']\").attr(\"selected\",\"selected\");
});
it adds an \ to the code and the code not workind how to fix it?

#952110

You are right the value attribute only work for custom field, it does not work for custom taxonomy.
And the JS codes of form does not saved correctly, it adds slash “\” before single quote and double quotes, I have escalated this issue, our developers will take care it.

Currently, I suggest you try to put the JS codes into a content template, use the content template to display the Toolset form shortcode [cred_form form="..."]

The custom JS codes will be able to be saved correctly in the content template.

Also you can still use the option 2) I mentioned above:
https://toolset.com/forums/topic/cred-form-for-specific-taxonomy/#post-951198

Please let me know if you need assistance to use the action hook "cred_save_data"

#952145

Our developers has provided a hot-fix the JS codes issue here:
https://toolset.com/errata/quotes-in-the-extra-css-or-js-content-will-get-backslashed/

Please test it and feedback if it is fixed, thanks

#955588

Thank you very much for your help...