Skip to Content Skip to Menu

[SOLVED] Trouble getting CB Conditional to function

  • edjec
  • edjec
  • OFFLINE
  • Posts: 132
  • Thanks: 12
  • Karma: 3
  • Add-ons
9 years 9 months ago - 9 years 8 months ago #258411 by edjec
CB 2.0.5
CB Conditionals 4.0.5
J 3.3.6

I’m setting up a new site and need to use conditionals to display or hide certain fields. I have used conditionals on other sites and it has always worked fine, but this time – not so much.

The trigger field will have a drop-down selectable value of 1 to 3 and is used to open from 1 to 3 sets of other fields depending on value selected. In the field sets I have conditionals set to Field conditional others = 1 (or 2, 3). However, under the Then panel, the show/hide fields do exactly the opposite of the title,e.g; Show will actually hide the fields selected and Hide displays fields selected. The same thing happens in the Field Options panel.

The second issue is that the trigger field selections do not function as intended in that no matter what number is selected the field sets do not display or hide as needed. I have tried both conditional self and conditional others and neither way functions.

Am I missing something?

Thanks
Last edit: 9 years 8 months ago by krileon.

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

  • edjec
  • edjec
  • OFFLINE
  • Posts: 132
  • Thanks: 12
  • Karma: 3
  • Add-ons
9 years 9 months ago #258412 by edjec
Scratch that.

The solution was to set each field set to Field condition self, If (select trigger field) >= 1 (or 2,3) Then mode Show. With this setting the fields do display when needed.

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

  • edjec
  • edjec
  • OFFLINE
  • Posts: 132
  • Thanks: 12
  • Karma: 3
  • Add-ons
9 years 9 months ago #258413 by edjec
After solving the display issue another problem arose.

If several fields in a field set are completed and the user selects the blank area on the drop-down selector, then any completed fields are deleted. If the user hits the Save button then his data will be deleted.

Is there a way to eliminate the blank position at the top of the drop-down selections?

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48479
  • Thanks: 8283
  • Karma: 1443
9 years 8 months ago #258499 by krileon
That's value resetting, it's supposed to do that. If you don't use value resetting then your conditions will not behave properly if you chained fields together. You can turn off value resetting within CB Conditional > Parameters by setting Reset to Disable, but I don't recommend it.

As for the blank position the only way to get rid of it is mark the field as Required. Otherwise it's always added for non-required select 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.
The following user(s) said Thank You: edjec

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

  • edjec
  • edjec
  • OFFLINE
  • Posts: 132
  • Thanks: 12
  • Karma: 3
  • Add-ons
9 years 8 months ago #258503 by edjec
Thanks for the explanation. In this case I can't set to Required, so I will have to live with the blank position.

Thanks again!

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

Moderators: beatnantkrileon
Powered by Kunena Forum