Skip to Content Skip to Menu

Conditional Required Fields issue

9 years 6 months ago - 9 years 5 months ago #263375 by shibumidesign
Conditional Required Fields issue was created by shibumidesign
Hi there,

I have a tab on my users profile/registration called Vehicle Info that has the following elements:
Own a Scion? No/Yes - dropdown select (Required - Default = No)
Values: 0 -> No, 1 -> Yes (2 -> I am a Dealership)
(tried to add option 2 -> I am a Dealership - but it broke my conditional requirements)

If No selected, hide the rest of the fields, if Yes selected, show the following:
Model Year - Dropdown select (required)
Model Name - Dropdown select (required)
Model Color = Dropdown select (required)
VIN - text field with REGEX VIN check (required)
Model Photo - image (not required)

Conditional Settings on field cb_own_scion:
Code:
Display: Field conditional others Is... Operator -> Equal To To... Value -> 0 Translate Value -> Yes Then... Fields -> Show -> none Fields -> Hide -> cb_model_year -> cb_model_name -> cb_model_colour -> cb_vin -> cb_model_photo Field Options -> Show -> none Field Options -> Hide -> none For... Registration -> Yes Profile Edit -> Yes Profile View -> Yes Userlists Search -> No Userlists View -> Yes

This was working fine until I tried to add an extra select option to "Own a Scion?" -> "I am a Dealership" - with my simple 0/No, 1/Yes select, I could set to no and I am not required to input any vehicle information, if set to yes, the vehicle info is now required to complete the form.

Now, the fields will hide if set to 0/No, but get error saying the Year, Model, Colour, and VIN are required fields. Why did adding an extra select option break this? I had changed the conditional settings to:
Is... Operator -> Not Equal To
To... Value -> 1
Translate Value -> Yes

I had even tried setting conditional settings for each of the vehicle info fields and still no luck.

The reason I am doing it this way, is if a visitor wants to join the site, but doesn't have a Scion they can't be expected to fill out the required vehicle information, the other scenario is if they are a Scion Dealership (which I was trying to add last night) they don't need to have vehicle information filled out. I also had it if they said no to Own a Scion, the member list would show "I don't own a Scion yet..." and I wanted to add "I am a Scion Dealership" if they selected Dealership. Both scenarios would not require vehicle info to but filled out, but if they said Yes, then the vehicle information fields are required.

Jeff

ShibumiDesignStudios.com - Ottawa.ScionOwners.ca
Joomla v3.4.1 - Kunena v3.0.8 - K2 v2.6.9 - CB v2.0.8
Last edit: 9 years 5 months ago by krileon.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48477
  • Thanks: 8281
  • Karma: 1443
9 years 6 months ago #263393 by krileon
Replied by krileon on topic Conditional Required Fields issue
CB version? CB conditional version? What is the value of the new option you added? When it's failing validation is it doing it after submitting the form or will it not let you submit the form at all? Do you also have CB Privacy installed? If so try disabling it (both act on same triggers to manipulate field display).


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.

9 years 6 months ago #263408 by shibumidesign
Replied by shibumidesign on topic Conditional Required Fields issue
CB 2.0.7, CB Conditional 4.0.5 - CB Privacy 4.0.3

Value of new option was set to "2", label set to "I am a Scion Dealership"

CB Privacy I believe is set to Tab, not individual fields - regardless, it was working before I tried to add "I am a Scion Dealership" when a user selected No, they were NOT required to fill in the required vehicle info fields, only if they selected Yes.

Jeff

ShibumiDesignStudios.com - Ottawa.ScionOwners.ca
Joomla v3.4.1 - Kunena v3.0.8 - K2 v2.6.9 - CB v2.0.8

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48477
  • Thanks: 8281
  • Karma: 1443
9 years 6 months ago #263412 by krileon
Replied by krileon on topic Conditional Required Fields issue
Does removing the newly added option cause the issue to go away? I just can't see why it'd conflict.


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.

9 years 6 months ago #263419 by shibumidesign
Replied by shibumidesign on topic Conditional Required Fields issue
Just checked and it looks like I had privacy enabled on the VIN field, disabled it, but still the same issue, if no selected and try to complete the form, tells me Vehicle info required and won't let me save - only on the profile edit form - registration seems to work fine when selecting No to Own a Scion.

I just don't get it... it was working just fine until I tried to add that extra condition/selection on the Own a Scion field.

Jeff

ShibumiDesignStudios.com - Ottawa.ScionOwners.ca
Joomla v3.4.1 - Kunena v3.0.8 - K2 v2.6.9 - CB v2.0.8

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48477
  • Thanks: 8281
  • Karma: 1443
9 years 6 months ago - 9 years 6 months ago #263453 by krileon
Replied by krileon on topic Conditional Required Fields issue
What do you mean by won't let you save? Clicking the submit button does nothing? or it sends you back to profile edit with a registration error? As the 2 are entirely different processing behaviors (1 is browser side and 1 is server side).


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.
Last edit: 9 years 6 months ago by krileon.

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

Moderators: beatnantkrileon
Powered by Kunena Forum