We are making a website where the users have to fill one of the two different form based on their subscription (basic and pro). We have a subscription taxonomy for the same. We want that the users who fill the basic form have their subscription taxonomy set as basic by defaults and the pro for the others. How can we implement this ?
Hello,
There isn't such kind of built-in feature within Toolset Forms plugin, see our document:
https://toolset.com/documentation/programmer-reference/forms/cred-shortcodes/#cred_field
value. Optional. Preset value ... Does not apply to all field types, e.g. taxonomies.
As a workaround, you can try with custom JS codes, for example, your custom taxonomy field is a checkboxes field, you can edit your post form, in section "JS Editor", add below codes:
jQuery(document).on('cred_form_ready', function(){
jQuery('input[data-value="basic"]').prop( "checked", true );
});
Please replace "basic" with your specific term's name
More help:
hidden link
Do I need to import or add JQuery somewhere before using it in the js editor or what because I did the same thing you suggested but it's not working?
Since it is a custom JS problem, please provide a test site with the same problem, fill website credentials in below private message box, also point out the problem page URL and form URL, I need to test and debug it in a live website, thanks
Thanks for the details, I assume we are talking about these:
1) page "Basic Provider Form":
hidden link
The JS codes work fine, I can see the option "Basic" is checked by default, see my screenshot: basic.JPG
2) page "Pro Provider Form":
hidden link
There isn't taxonomy field "Subscription" in above form, where do you want to enable the option "Pro"?
My issue is resolved now. Thank you!