2

I have a form in Chronoform where there are two checkboxes, when you select the second checkbox, a hidden DIV becomes visible. Inside this hidden DIV there are 12 more checkboxes. At least one of those checkboxes must be selected to move on.

With the first two checkboxes, I am using class="validate['group[1]']" which works great to force the user to choose between the first two options.

I tried using class="validate['group[2]']" on the checkboxes in the hidden DIV, but if the DIV remains hidden, it is still forcing the validation. So you can't move on, unless you open that DIV and select at least one option.

How do I validate the checkboxes in the hidden DIV only if the hidden DIV is opened?

EDIT: you can see the form in action here: http://www.ryanduffdesign.com/form

I am open to using custom scripts like jQuery on the server side, if needed.

I'm not a strong coder, so please go easy on me.

Melvins138
  • 81
  • 9
  • Please show some code. – MDJ Aug 20 '14 at 22:11
  • I will try to get something up on jsbin or jsfiddle soon. The problem I have is that the checkboxes and the hidden DIV is set up in Joomla using ChronoForms, so there is some issues with that. I will try to get something viewable soon. Thanks for the quick response. – Melvins138 Aug 20 '14 at 23:29
  • This wasn't an issue for me on ChronoForms v5 on Joomla 3.x as per https://www.chronoengine.com/forums/posts/t95421/p330955/hide-unhide-div-container-easy.html#p330955 - maybe try `display: none;` / `display: block;` rather than `visibility: hidden;` / `visibility: visible;` if you haven't already. You will likely get a better response to this question at http://joomla.stackexchange.com or at http://www.chronoengine.com/forums – Neil Robertson Aug 21 '14 at 03:53
  • 1
    Thanks Neil. I followed a ChronoForm FAQ [link](http://www.chronoengine.com/faqs/58-cfv4/cfv4-elements-and-html/2645-how-can-i-showhide-a-textarea-when-a-checkbox-is-clicked.html) on hidden DIVs, and have the hidden DIV working, using display:none; based on their suggestions. My problem is that the checkboxes inside the hidden DIV need to be validated if the hidden DIV is displayed. I have posted this to the chronoengine forum, but haven't heard back. I will try and post the code here tomorrow. Thanks again Neil for the suggestions, I will try in the joomla.stackexchange section. – Melvins138 Aug 21 '14 at 04:36
  • you can see the form in action here: http://ryanduffdesign.com/form/ – Melvins138 Aug 21 '14 at 16:07

0 Answers0