Link to home
Start Free TrialLog in
Avatar of razor19
razor19

asked on

Automatically checking / un-checking inputs.

Here's what i'm trying to do:

I have a list of inputs, when you select a child input, all parent inputs need to be check marked. If you uncheck a parent input, all checked children need to be unchecked.

I found this example online - it replicates the desired functionality perfectly:
http://jsfiddle.net/3y3Pb/14/

However, even though my markup is structurally similar to the example (ul > li) it doesn't work with my markup. This markup is coming from a WordPress plugin that I can not modify.

You can see my code (with markup here): http://jsfiddle.net/3y3Pb/223/

I've narrowed it down to the
<label>

Open in new window

element that seems to be wrapping each input. If I remove the label the example code works fine.  Since i'm not able to remove the label, I need a solution that works with markup in the above example.

Here's a demo of the same code without the label working as intended: http://jsfiddle.net/3y3Pb/225/
ASKER CERTIFIED SOLUTION
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of razor19
razor19

ASKER

Thank you SO much. I can't believe I missed that. :|
You are welcome.