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
Here's a demo of the same code without the label working as intended: http://jsfiddle.net/3y3Pb/ 225/
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/
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/
I've narrowed it down to the
<label>
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/
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You are welcome.
ASKER