Skip Navigation

[Resolved] how to select checkboxes taxonomy only one value

This support ticket is created 2 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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 6 replies, has 2 voices.

Last updated by fabioF-5 2 years, 11 months ago.

Assisted by: Minesh.

Author
Posts
#2253149

hello
Tell us what you are trying to do?
I'm working on frontend building a customer form.
I selected a custom taxonomy like TAGS and now when I add new customer i can choose only one of taxonomy selected. I solved in backend to choose only one value of taxonomy with plugin that permit to choose only one selection of taxonomy.
It works fine in backend but in frontend form I continue to have
list of taxonomy that acccept selection of all taxonomy.
a [ ]
b [ ]
c [ ]

Is there any documentation that you are following?

I'm trying to use this advise but I haven't any idea how to use attribute " single_select='true' in form
https://toolset.com/forums/topic/how-do-i-make-a-taxonomy-a-single-only-selection/
I see online it's possible with few code of javascript but do you have an example how to add JS onclick function on cred form?
I need custom when click on checkboxes A, deselect other B - C boxes.
Can you give me some example?

What is the link to your site?
I'm working offline on a project
Thank you
Best regards

#2253321

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

The single_single attribute will only be effective when you display the taxonomy terms as dropdown select box.

For example:

[cred_field field='category' output='bootstrap' display='select' single_select='true']

Where:
- Replace "category" with your original taxonomy slug.

More info:
=> https://toolset.com/documentation/user-guides/cred-shortcodes/#cred_field

#2253327

Hi thanks for your reply, I understand about single attribute.
I need to use checkboxes and I find this way that work fine on checkboxes type : field

jQuery( document ).ready(function() {
jQuery('.wpt-form-set-checkboxes-wpcf-templ input[type=checkbox]').click(function(){
jQuery('.wpt-form-set-checkboxes-wpcf-templ input[type=checkbox]').not(this).prop('checked', false);
});
});
but when I try to use on list of checkboxes taxonomy, it doesn't work

Do you have the correct code to use with taxonomy hierarchical?

#2253399

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Do you mean you want users to select only one checkbox option from the list of checkboxes option? if yes,

Can you please share problem URL where I can see the checkboxes field and admin access details.

*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin and FTP) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.

I have set the next reply to private which means only you and I have access to it.

#2253409

Sorry, but I'm working on my project offline in xamp locally.
My site isn't ready to pubblish yet

#2253415

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Then the only option is - If you can then share duplicator copy of your site and send me link to download it and share problem URL and access details.
=> https://toolset.com/faq/provide-supporters-copy-site/

I have set the next reply to private which means only you and I have access to it.

#2255809

My issue is resolved now. Thank you!