[SOLVED] Use multicheckbox and CB Conditional to show other

12 years 11 months ago - 12 years 11 months ago #163347 by superstega
Hi to all,
i'm sorry 4 my bad english.
This is the scenario:
A multicheckbox field named cb_categorie
For each checked checkbox i would show 2 new multicheckbox fields
cb_giorni (weekday's list)
cb_orario (mornig, afternoon, night, late night)

Site's administrator can add more items on cb_categorie.

All fields must be searchable.

How can i do?

thanks

Please Log in to join the conversation.

12 years 11 months ago #163369 by krileon
If I understand you correctly you want to show 2 fields based off another fields value? If this is the case you could use incubator project CB Conditionals which is designed to conditionally display fields based off another fields values.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

12 years 11 months ago #163445 by superstega
You understand me correctly. :woohoo:
I've installed CB Conditionals.

Every time administrator adds a new category he must adds 2 extra fields for cb_giorni and cb_orario?

How can i set the conditions for display right fields based on user's choice?

example

cb_categorie:
Tennis
Jogging
Soccer
Baseball

hidden fields:
cb_giorni[Tennis]
cb_orario[Tennis]

cb_giorni[Jogging]
cb_orario[Jogging]

cb_giorni[Soccer]
cb_orario[Soccer]

cb_giorni[Baseball]
cb_orario[Baseball]

When user check Tennis in cb_categorie the fields
cb_giorni[Tennis]
cb_orario[Tennis]
must be visible


When user check Jogging in cb_categorie the fields

cb_giorni[Jogging]
cb_orario[Jogging]
must be visible

etc etc

In profile page, users can modify their choices.

All choices must be searchable by a custom form.:dry:

Please Log in to join the conversation.

12 years 11 months ago #163465 by krileon
I see, you're wanting to hide the values of some multi-select or single-select fieldtypes? If this is the case then this is not possible. CB Conditional can only show/hide entire fields based off another fields value. If cb_giorni[Tennis] is a completely different field then cb_giorni[Jogging], then it's very doable. Simply edit cb_giorni[Tennis] and set its condition to be based off another field then setup the checking as necessary; you'd repeat this for all other fields.


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.

Please Log in to join the conversation.

12 years 11 months ago #163928 by superstega
I used many single category fields and make other subfields conditionals with CB Conditionals.

categories:
cb_Tennis (singlecheckbox)

hidden fields:
cb_giorniTennis (multicheckbox) -> (cb_Tennis == 1)?show():hide();
cb_orarioTennis (multicheckbox) -> (cb_Tennis == 1)?show():hide();

categories:
cb_Jogging (singlecheckbox)

hidden fields:
cb_giorniJogging (multicheckbox) -> (cb_Jogging == 1)?show():hide();
cb_orarioJogging (multicheckbox) -> (cb_Jogging == 1)?show():hide();

Please Log in to join the conversation.

Moderators: beatnantkrileon
Time to create page: 0.202 seconds

Facebook Twitter LinkedIn