following is my code, can any one tell me whats going wrong.
<input type="checkbox" name="Chk[]" value="<?php echo($arr['id']); ?>" onClick="Click()" id="CK">// all checkboxex
<input onClick="selectall()" type="checkbox" value="yes" name="c1">// one checkbox
/*function called*/
function selectall()
{
if(document.frm.chk.value=="false")
{
document.frm.chk.value="true";
for(var i=0; i<document.frm.elements.length; i++)
{
if((document.frm.elements[i].type)=="checkbox")
{
document.frm.elements[i].checked = true;
}
}
}
else if(document.frm.chk.value=="true")
{
document.frm.chk.value="false";
for(var i=0; i<document.frm.elements.length; i++)
{
if((document.frm.elements[i].type)=="checkbox")
{
document.frm.elements[i].checked = false;
}
}
}
}