dellon
asked on
Validation: If radiobutton is checked, at least 1 checkbox is checked... and...
Ok experts.. I have 2 radiobuttons. A and B.
If radiobutton A is checked, then at least 1 checkbox need to be checked.
There are a list of checkboxes, all of them with the same name just different values. So it will be validating an array.
...And...
On some of the checkboxes option, there's text fields.
So when a particular checkbox is checked, the field also need to have a value. I'll try to draw it out below.
I don't know if this add into the complexity, but I wrote it so that only when radiobutton A is checked, the options are shown, by toggling between css style hidden / not.
o = radiobutton
x = checkboxes
___ = textfields
-------------------------- ---------
o Radiobutton A o Radiobutton B
x option 1
x option 2
x option 3 text field _______
x option 4
.. the options goes on.
If radiobutton A is checked, then at least 1 checkbox need to be checked.
There are a list of checkboxes, all of them with the same name just different values. So it will be validating an array.
...And...
On some of the checkboxes option, there's text fields.
So when a particular checkbox is checked, the field also need to have a value. I'll try to draw it out below.
I don't know if this add into the complexity, but I wrote it so that only when radiobutton A is checked, the options are shown, by toggling between css style hidden / not.
o = radiobutton
x = checkboxes
___ = textfields
--------------------------
o Radiobutton A o Radiobutton B
x option 1
x option 2
x option 3 text field _______
x option 4
.. the options goes on.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Your script worked like a charm. Thanks!