Forums

case-dependant checkboxes

jeffrourke 15 Feb, 2014
Hi.

Really liking Chronoforms 5, but run into a bit of a quandry.

In a form intended solely to push the information into a Table, I have a dropdown with four choices, followed by a checkbox group containing six checkboxes.

The items in the checkbox group are case-dependant, based on the selection made within the dropdown above.

Example: If dropdown option 1 is selected, only checkboxes 2, 3, 4 and 6 should be displayed / 'unlocked'.

Example: Dropdown 2 is chosen, only checkboxes 1, 2, 5 and 6 should be 'available'.

Hope this makes sense.

And is possible.

Thanks!
jeffrourke 16 Feb, 2014
On actual inspection, turns out the spec is totally different to that which I was promised!

It's a Joomla 2.5 install. With Chronoforms and connect V4.

My apologies!
GreyHead 16 Feb, 2014
Hi jeffrourke,

You have to do this with Custom JavaScript. Add an OnChange event to the dropdown that calls a function. In the function check the state of the drop-down and hide/show the appropriate checkboxes - actually the wrapping divs around the checkboxes and their labels. As an alternative you could also leave the checkboxes visible and disable/enable instead.

I would also uncheck any hidden/disabled checkboxes to be tidy.

Bob.
jeffrourke 16 Feb, 2014
Thanks, Bob!

prompt and to-the-point assistance.
This topic is locked and no more replies can be posted.