Skip to Content Skip to Menu

[SOLVED] Hidden Fields that in some cases are required.

  • AlexRag
  • AlexRag
  • OFFLINE
  • Posts: 614
  • Thanks: 36
  • Karma: 6
1 month 3 days ago - 1 month 1 day ago #337845 by AlexRag
I have a use case question.  

I have a field item that depending on Yes/No will display a second yes/no field item.   

eg.   
1. Would you like to join a committee?   Y/N 
2. Would you also like to lead the committee?  Y/N. (Hidden if #1 is No)

I used CB Conditionals to hide the second question if the first answer was No. However, if the answer is Yes Question # 2 must also be answered (required).   

If I set the second to required and thus never revealed since the first answer was No, will the registration form submit work?   

If not would I be better off prepopulating the answer to Question 2 to No so it contains an answer?

Thanks!

 
Last edit: 1 month 1 day ago by AlexRag.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 68605
  • Thanks: 9108
  • Karma: 1434
1 month 2 days ago #337855 by krileon
CB Conditional can't make something required. So you'd either have to make your second field required for everyone or make a 3rd field that is required and take into account whatever the other condition is that would constitute it sometimes being required.

As for hiding a required field CB Conditional will suppress all of its validation so that's not a problem.


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.

  • AlexRag
  • AlexRag
  • OFFLINE
  • Posts: 614
  • Thanks: 36
  • Karma: 6
1 month 2 days ago #337866 by AlexRag

As for hiding a required field CB Conditional will suppress all of its validation so that's not a problem.


I think this is what I was looking for.    To confirm,  If question #2 is hidden (By CB Conditionals), it ignore the "required" setting in the field.     
 

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 68605
  • Thanks: 9108
  • Karma: 1434
1 month 1 day ago #337875 by krileon

To confirm, If question #2 is hidden (By CB Conditionals), it ignore the "required" setting in the field.

Correct. All validation will be ignored for the field if hidden by CB Conditionals.


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: AlexRag

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

Moderators: beatnantkrileon
Powered by Kunena Forum

Facebook Twitter LinkedIn