Skip to Content Skip to Menu

🌟 CB Editor Assistant 1.0.0 is here! Discover our new AI Joomla Plugin that wrote its story! (and this banner!)
Start at just $12.50/month* or 💸 save 30% with our 🛍️ Black Friday Intro Offer for your subscription's lifetime
🎉 Black Friday sale is here! Great savings on professional and developer memberships! Get 25% off now with code BLACK-FRIDAY-2024!

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

  • AlexRag
  • AlexRag
  • OFFLINE
  • Posts: 501
  • Thanks: 33
  • Karma: 6
7 months 1 week ago - 7 months 1 week 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: 7 months 1 week ago by AlexRag.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48560
  • Thanks: 8292
  • Karma: 1445
7 months 1 week 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: 501
  • Thanks: 33
  • Karma: 6
7 months 1 week 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: 48560
  • Thanks: 8292
  • Karma: 1445
7 months 1 week 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