i want to toggle checkboxes when i toggle
lets say i have multiple checkboxes...
and i have a single checkbox that when i check, there will be a function that will make them all checked or unchecked.
how will i make it?
while (condition) {
$i++;
echo "
<tr>
<td>$i </td>
<td valign=\"top\"><input type=\"checkbox\" name=\"$R\" value=\"???"></td>
<td valign=\"top\">Item $i</td>
<tr> ";
}
<form action="urlxxx.php" method="post" target="_self">
<table>
<tr>
<td><input type="checkbox" name="toggle" value="toggle">Toggle All </td>
<td><input type="submit" name="submit" value="Submit"></td>
</tr>
</table>
</form>
here is some code i got somewhere to output the checkboxes(results from a query). but how do i make an event where i click the checkbox on the bottom so that all the checkboxes will toggle checked/unchecked.
thanx for any help