Skip to Content Skip to Menu

Conditional usecase question

  • liaskas
  • liaskas
  • OFFLINE
  • Posts: 382
  • Thanks: 36
  • Karma: 2
  • Add-ons
7 years 1 week ago #298159 by liaskas
Conditional usecase question was created by liaskas
Hello

We have 3 fields on registration.

Is it possible that the 3d field is conditioned by the other 2 field values selection?

Example

If... Field_1 selected value is A1 and Field_2 selected value is B2

then... hide some values and show the rest in Field3

Thank you in advance.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48444
  • Thanks: 8279
  • Karma: 1443
7 years 1 week ago #298172 by krileon
Replied by krileon on topic Conditional usecase question
No, CB Conditional does not support AND/OR conditioning at this time. The conditions are all currently independent of one another with only the last condition applying mattering. AND/OR conditional support is planned in the CB Conditional rewrite that I will be starting soon.


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 or Create an account to join the conversation.

  • liaskas
  • liaskas
  • OFFLINE
  • Posts: 382
  • Thanks: 36
  • Karma: 2
  • Add-ons
7 years 1 week ago #298175 by liaskas
Replied by liaskas on topic Conditional usecase question
Thank you Krileon.
We will wait.

Please Log in or Create an account to join the conversation.

  • liaskas
  • liaskas
  • OFFLINE
  • Posts: 382
  • Thanks: 36
  • Karma: 2
  • Add-ons
6 years 11 months ago #299524 by liaskas
Replied by liaskas on topic Conditional usecase question
Hello again!

Same usecase for the new conditionals plugin.

I searched and tried to figure out how to set things work now that the conditionals plugin supports AND / OR conditioning with no luck!

So the question is the same. Is it possible that the 3d field is conditioned by the other 2 field values selection as shown in the example bellow?

If... Field_1 selected value is A1 and Field_2 selected value is B2

then... hide some option values and show the rest in Field3

If yes... how will we do it?

Where do we choose the allowed field values for each combination of A1 and B2?

Thank you in advance!

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 48444
  • Thanks: 8279
  • Karma: 1443
6 years 11 months ago #299540 by krileon
Replied by krileon on topic Conditional usecase question
You can only show/hide an entire field/tab. You can't show/hide the options of a field using CB Conditional. The best way to accomplish that is to dynamically output the dropdown options using a CB Query Field or CB Code Field then add your conditions to your custom database query or custom PHP. Next you'd use CB Core Fields Ajax and its Update On usage to refresh the display of the field when Field_1 or Field_2 values change.

Sorry, I misunderstood your original question and thought you wanted to show/hide a field if both conditions matched.


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 or Create an account to join the conversation.

  • liaskas
  • liaskas
  • OFFLINE
  • Posts: 382
  • Thanks: 36
  • Karma: 2
  • Add-ons
6 years 10 months ago #299975 by liaskas
Replied by liaskas on topic Conditional usecase question
OK...

i tried to follow the way you pointed to me Krileon and thank you.

I created a new multiselect dropdown query field and created the selection for Parameters / Query / Query...

SELECT fieldtitle
FROM jos_comprofiler_field_values
WHERE fieldlabel LIKE (my field values here);

The above returns the values but it is not what we want.

So i tried Parameters / Query / Query...

[cb:if user="#displayed" column_name_1="A1" and column_name_2="B1"]SELECT fieldlabel FROM jos_comprofiler_field_values
WHERE fieldlabel = 'option1' AND fieldlabel = 'option3' AND fieldlabel = 'option5';
[cb:if user="#displayed" column_name_1="A1" and column_name_2="B2"]SELECT fieldlabel FROM jos_comprofiler_field_values
WHERE fieldlabel = 'option2' AND fieldlabel = 'option4';

It returns nothing! Is this the right way? (probably not)

Can you please advise?

Thank you.

Please Log in or Create an account to join the conversation.

Moderators: beatnantkrileon
Powered by Kunena Forum