[eluser]bianchi[/eluser]
Hello friends,
I wanna have a "check all" check box in my form,
but when it's an array the javascript won't work,
Any of you ever hv a same situation,
Please share with me...
I will be gratefull for every response,
I can't use
"onClick="UnCheckAll(document.airline_form.airline[])">"--->not working...
Regards,
CI Developer...
================
<html>
<head>
[removed]
<!--
<!-- Begin
function CheckAll(chk)
{
for (i = 0; i < chk.length; i++)
chk[i].checked = true ;
}
function UnCheckAll(chk)
{
for (i = 0; i < chk.length; i++)
chk[i].checked = false ;
}
// End -->
[removed]
</head>
<body>
<br>
<form name="airline_form" action="checkbox/delete" method="post">
<input type="button" name="Check_All" value="Check All">
<input type="button" name="Un_CheckAll" value="Uncheck All">
<input type="submit" value="DELETE" class="button"/>
<br>
<? //foreach($query as $row){ echo "<option value='$row->code2'>$row->name</option>";}
foreach($query as $row){ echo "<input type='checkbox' name='airline[]' value='$row->code2'>$row->name<br>";}?>
<input type="submit" value="DELETE" class="button"/>
</form>
</body>
</html>