Skip to Content Skip to Menu

🕒 Save Time and Effort with CB Editor Assistant: Effortlessly create and refine content in Joomla 3, 4, & 5.
🎁 Limited Offer: Enjoy a 5-day FREE trial and save up to 30% afterward!

[SOLVED] Help with 3 option conditional

  • fredc15
  • fredc15
  • OFFLINE
  • Posts: 37
  • Thanks: 5
  • Karma: 0
7 years 9 months ago - 7 years 2 months ago #292716 by fredc15
I am wanting to use a conditional for a field with 3 options

Based on user selection, A second field will or will not display. Below are the rules I am trying to implement

If a User selects Option 1 Field 2 will not display

If a User selects Option 2 Field 2 will display

If a User selects Option 3 Field 2 will display


I am currently only getting this this work if a user selects Option 2. I tried with 4 conditionals for the 2nd and 3rd option, only one option would work correctly.


I set this up according to the following conditional for Field 1

Conditional 1
Display: Field conditional others

Operator: Equal to

Value: Option 2

Then... Fields Show: Field 2


Conditional 2
Display: Field conditional others

Operator: Not Equal to

Value: Option 2

Then... Fields Hide: Field 2
Last edit: 7 years 2 months ago by krileon. Reason: Added [SOLVED] tag to subject

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48707
  • Thanks: 8319
  • Karma: 1447
7 years 9 months ago #292734 by krileon
Replied by krileon on topic Help with 3 option conditional
You can not condition a field more than once. To accomplish what you're wanting with 1 condition you'd use the below by adding the condition directly to the field you want conditioned.

Display: Field conditional self
Field: YOUR_FIELD_HERE
Operator: Is REGEX
Value: /OPTION_2|OPTION_3/
Translate Value: No
Mode: Show

The only reason for the 5 condition tabs was per request of a user who was heavily using Conditional Others, which will be removed in a later release when AND/OR usage is implemented. So I do not recommend using Conditional Others unless you need to mass-condition a large amount of fields at once.


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.

7 years 2 months ago #298625 by shanenefdt
Replied by shanenefdt on topic Help with 3 option conditional

krileon wrote: You can not condition a field more than once. To accomplish what you're wanting with 1 condition you'd use the below by adding the condition directly to the field you want conditioned.

Display: Field conditional self
Field: YOUR_FIELD_HERE
Operator: Is REGEX
Value: /OPTION_2|OPTION_3/
Translate Value: No
Mode: Show

The only reason for the 5 condition tabs was per request of a user who was heavily using Conditional Others, which will be removed in a later release when AND/OR usage is implemented. So I do not recommend using Conditional Others unless you need to mass-condition a large amount of fields at once.


I want to provide a drop-down selector for clients to select from a predetermined list and the switch various tabs related to the values - is this possible by adding more than 1 value into the conditional "To" area - for example the vaues I am using are IA03 or IA08 or IA09? I have tried various options listed in the documentation with no success as yet...
If this is not possible then what would you recommend I do?

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48707
  • Thanks: 8319
  • Karma: 1447
7 years 2 months ago #298628 by krileon
Replied by krileon on topic Help with 3 option conditional
If you want a condition to match multiple values of a field you do exactly as I've instructed above. So in your case you'd have the below.

Display: Field conditional self
Field: YOUR_FIELD_HERE
Operator: Is REGEX
Value: /IA03|IA08|IA09/
Translate Value: No
Mode: Show


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.

7 years 2 months ago #298634 by shanenefdt
Replied by shanenefdt on topic Help with 3 option conditional
Thank you - this works perfectly! Its not too clear in the documentation...
The following user(s) said Thank You: krileon

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48707
  • Thanks: 8319
  • Karma: 1447
7 years 2 months ago #298635 by krileon
Replied by krileon on topic Help with 3 option conditional
It'll be a lot easier with CB Conditional 5.0.0 since AND/OR usages will be supported. You can take a look at what to expect for condition configuration in CB Conditional 5.0.0 below.

www.joomlapolis.com/forum/6-news-and-publicity/237682-what-am-i-working-on#298538


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.

Moderators: beatnantkrileon
Powered by Kunena Forum