while ($row= mysql_fetch_array($result, MYSQL_ASSOC))
{ $id=$row[id];
$html=<<<html
<tr><td>
<input style="float:left" type="checkbox" id="$id" name="myBoxes[$id]" value="true">
<span style="float:left">$row[content]</span>
<span style="color:black;float:right">$row[submitter]</span></td></tr>
html;
echo $html;
}
$html=<<<html
</table>
<span onclick="selectAll(true)" style="cursor:pointer;color:black">All</span>
 
<span onclick="selectAll(false)" style="cursor:pointer;color:black">None</span><br/>
<input type="submit" value="Submit"/>
html;
echo $html;
JQuery kodu:
function selectAll(argument)
{
$("INPUT[type='checkbox']").attr('checked',argument);
}
PHP kodu:
<?php foreach ($_POST['myBoxes'] as
$id => $value) { echo $value;
echo "<br/>";} ?>
Neden bir hata mesajı alıyorum
Warning: Invalid argument supplied for foreach() in E:\xampp\htdocs\piecework\groupcheck.php on line 2
Ben "Yok" tıklayın ve "teslim" ne, sorun ne?