PHP Array Checkbox

Tuesday, December 23, 2008




function CheckAll(chk)
{
var chk = document.myform['check[]'];
for (var i = 0; i < chk.length; i++)
{ chk[i].checked = true ; }
}

function UnCheckAll(chk)
{
var chk = document.myform['check[]'];
for (i = 0; i < chk.length; i++)
{ chk[i].checked = false ; }
}

form name="myform"
while {
input type="checkbox" name="check[]" value="1"
}

input type="button" name="Check_All" value="Check All" onClick="CheckAll(document.myform.check)"

input type="button" name="Un_CheckAll" value="Uncheck All" onClick="UnCheckAll(document.myform.check)"