Skip to Content Skip to Menu

🎃 Happy Halloween! Treat yourself with an awesome discount on memberships! Get 20% off now with code SPOOKY-2024!

CB Conditionnal

  • agrepe
  • agrepe
  • OFFLINE
  • Posts: 245
  • Thanks: 3
  • Karma: 0
9 years 3 months ago - 9 years 3 months ago #267089 by agrepe
CB Conditionnal was created by agrepe
Hello,
I need help about CB_conditional . (CB 2.0.9 )
I can not do a thing.
I have a field that offers 3 choices :
For example: This field is named "AAA" (it's a list)
- " Choice1 "
- " Choice2 "
- " Choice3 "

Then I have a field ( This field is named "BBB" which is a text field) to be displayed when :
" Choice1 " is validated
or
" Choice3 " is validated
(but not when " Choice2 " is)

I can not declare the two conditions, it is only the latter that works every time .

For that I use: " Fiel conditional self"
then I ask to check in "AAA" is enabled what field ?
Condition 1:
When the field is equal to " Choice1 " then I show " BBB "

Condition 2:
When the field is equal to " Choice3 " then I show " BBB "

My first condition is ignored as soon as I overlaps a new condition , I did not find as saying Condition 1 "or" Condition 2

Best regards.

Eric
Last edit: 9 years 3 months ago by agrepe.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48477
  • Thanks: 8281
  • Karma: 1443
9 years 3 months ago #267094 by krileon
Replied by krileon on topic CB Conditionnal
You can not condition a field multiple times. There is no AND/OR support at this time. Each condition acts independently. This means the last condition applied to a field is the only codition that matters. For your usage you don't need multiple conditions though. You should be able to just use a REGEXP condition. Try the following.

Operator: Is REGEX
Value: /Choice1|Choice2/

The | acts as OR in REGEX so you can match multiple values from a single field.


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.

  • agrepe
  • agrepe
  • OFFLINE
  • Posts: 245
  • Thanks: 3
  • Karma: 0
9 years 3 months ago #267119 by agrepe
Replied by agrepe on topic CB Conditionnal
Thank you for your help .
I do not know the regular expression syntax when you say "Value : / Choice1 | Choice2 / " how would be used in my case ?

If I take my lead.
I put that phrase in the "BBB" range to be displayed according to the choice of "AAA " field, is that right ?

Best regards.

Eric

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48477
  • Thanks: 8281
  • Karma: 1443
9 years 3 months ago #267123 by krileon
Replied by krileon on topic CB Conditionnal

I do not know the regular expression syntax when you say "Value : / Choice1 | Choice2 / " how would be used in my case ?

I've already provided you the syntax. You separate the values of that field you want to match with |. Example as follows

/VALUE1|VALUE2|VALUE3/


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