Here at TSDN we are more than happy to assist you with your questions but we do ask that you attempt it yourself first. Please try it out and if your code isn't working please provide that section of code and we can help you from there.
************************************************** ***************************************
This is my code. I like to call same function for both section to check different section
[HTML]function Checkall(form){
for (var i = 1; i < form.elements.length; i++){
eval("form.elements[" + i + "].checked = true");
}
}
<body>
<form name="frm" method="post" action="" onsubmit="chk(this)">
<input type="checkbox" name="on" onClick="Checkall(frm);" />book<br />
<input type="checkbox" name="c[]" value="1" /> checkbox 1<br />
<input type="checkbox" name="c[]" value="2" /> checkbox 2<br />
<input type="checkbox" name="c[]" value="3" /> checkbox 3<br />
<input type="checkbox" name="c[]" value="4" /> checkbox 4<br />
<input type="checkbox" name="c[]" value="5" /> checkbox 5<br /> <br />
<input type="checkbox" name="un" onClick="Checkall(frm);" />food<br />
<input type="checkbox" name="f[]" value="1" /> checkbox 1<br />
<input type="checkbox" name="f[]" value="2" /> checkbox 2<br />
<input type="checkbox" name="f[]" value="3" /> checkbox 3<br />
<input type="checkbox" name="f[]" value="4" /> checkbox 4<br />
<input type="checkbox" name="f[]" value="5" /> checkbox 5<br />
<!--<input type="submit" value="submit" /> -->
</form>
</body>[/HTML]