Skip to Content Skip to Menu

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

Problem with Conditional Function

  • haidinh
  • haidinh
  • OFFLINE
  • Posts: 94
  • Thanks: 8
  • Karma: 0
9 years 2 months ago #269385 by haidinh
Problem with Conditional Function was created by haidinh
Hi supporters,
I have a problem with conditional function, please review and help me out.
I have 8 fields: Country, Province, pro1, pro2, pro3, pro4, pro5, pro6
Field “Country” is a single drop down field, has six values: Vietnam, America, England, Japan, France and Spain.
Field “Province” (is an attribute of field “Country” when value is Vietnam) is also a single drop down field, has six values: 1, 2, 3, 4, 5 and 6.
Field “Pro1” (is an attribute of field “Province” when value is 1) is a single drop down field too, with 7 values.
Field “Pro2” (is an attribute of field “Province” when value is 2) is a single drop down field too, with 7 values.
Field “Pro1” (is an attribute of field “Province” when value is 3) is a single drop down field too, with 7 values.
Field “Pro4” (is an attribute of field “Province” when value is 4) is a single drop down field too, with 7 values.
Field “Pro5” (is an attribute of field “Province” when value is 5) is a single drop down field too, with 7 values.
Field “Pro6” (is an attribute of field “Province” when value is 6) is a single drop down field too, with 7 values.
I set conditional-others to field Country:
- When its value is “Vietnam”, field “Province” will show.
I set conditional-others to field “Province”:
- When the value is 1, field “Pro1” will show.
- When the value is 2, field “Pro2” will show.
- When the value is 3, field “Pro3” will show.
- When the value is 4, field “Pro4” will show.
- When the value is 5, field “Pro5” will show.
- When the value is 6, field “Pro6” will show.
I tried in frontpage and the result is as follows:
First, I choose field “Country” value is “Vietnam”, field “Province” is showed.
Then, I choose field “Province” value is 3, field “Pro3” is showed, and I can choose one of its 7 values.
After that, I changed value of field “Country” from “Vietnam” to “Spain”, field “Province” is hiden, but field “Pro3” is still showed.
My question is that: How I can hide field “Pro3” this case, because it is not an attribute of field “Spain”, “Pro3” should only be showed when field “Province” is showed.
Please note that:
1. If I choose Spain from the beginning, field “Pro3” is not showed.
2. I tried to set conditional-self to fields “Pro1”, “Pro2”, “Pro3”, “Pro4”, “Pro5” and “Pro6” that when value of field “County” is not equal to Vietnam, they will hide. But after that, when I choose value “Vietnam” to field “Country”, all these fields (Pro1, Pro2, Pro3, Pro4, Pro5, Pro6) shows while I only need one field showed at each time according to value of “Provine” field.
Thank you and looking forwards to your reply.
Hai Dinh

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48473
  • Thanks: 8281
  • Karma: 1443
9 years 2 months ago #269402 by krileon
Replied by krileon on topic Problem with Conditional Function
Edit your Pro1-6 fields and put the condition directly on them using Conditional Self. Always use Conditional Self over Conditional Others when possible, especially if only conditioning 1 field. Conditional Others should be reserved for if you want 1 value from a field to show/hide a mass amount of fields (tbh conditional others probably needs to go away in a later CB Conditional release).

Next ensure within CB Conditional > Parameters that value resetting is enabled. This will reset a fields value when it's hidden and allow conditions to chain properly. It should be enabled by default.

2. I tried to set conditional-self to fields “Pro1”, “Pro2”, “Pro3”, “Pro4”, “Pro5” and “Pro6” that when value of field “County” is not equal to Vietnam, they will hide. But after that, when I choose value “Vietnam” to field “Country”, all these fields (Pro1, Pro2, Pro3, Pro4, Pro5, Pro6) shows while I only need one field showed at each time according to value of “Provine” field.

You need to condition them off Province, not off Country. Province then should conditional self off Country. If value resetting is used this will all chain correctly.


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.
The following user(s) said Thank You: haidinh

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

  • haidinh
  • haidinh
  • OFFLINE
  • Posts: 94
  • Thanks: 8
  • Karma: 0
9 years 2 months ago #269436 by haidinh
Replied by haidinh on topic Problem with Conditional Function
Thank you Krileon,

I will try and will ask you later if have any more problems.

Hai Dinh

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

Moderators: beatnantkrileon
Powered by Kunena Forum