checkbox group checking (DOM)

U

uoziod

Hello.

Sorry for my english :)

I got a next problem. This is a HTML.

<ul>
<li id="cat3"><input type="checkbox"
onChange="javascript:groupCatCheck('3', this)" name="categories[]"
value="3" />(3)</li>
<ul>
<li id="cat5"><input type="checkbox"
onChange="javascript:groupCatCheck('5', this)" name="categories[]"
value="5" />(5)</li>
<li id="cat8"><input type="checkbox"
onChange="javascript:groupCatCheck('8', this)" name="categories[]"
value="8" />(8)</li>
<ul>
<li id="cat15"><input type="checkbox"
onChange="javascript:groupCatCheck('5', this)" name="categories[]"
value="15" />(15)</li>
<li id="cat18"><input type="checkbox"
onChange="javascript:groupCatCheck('8', this)" name="categories[]"
value="18" />(18)</li>
</ul>
</ul>
</ul>

So, I need check all children group if I'll checking one parent
checkbox.
I'm using javascript function, that runing thru childNodes... but when
I trying to call this function inside itself all future nodes are
disappears :(
Can anybody help my mind? :(((
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,165
Latest member
JavierBrak
Top