hello, i use javascript to check-all and encheck-all the checkboxes, but when there is more than one checkboxes, it works, but if there is only one checkbox, it wont work, and below is the coding:
function checkall(ckb)
{
alert (ckb.length)
for (i =0; i<ckb.length;i++)
if(ckb[i].type == "checkbox")
{
if(!ckb[i].checked == true)
{
ckb[i].checked = true;
}
}
}
when there is only one checkbox, the ckb.length is undefined, anyone can help me?? thanks a lot