テーブル行のチェックボックスを1つだけ無効にするにはどうすればよいですか?phtmlファイルにfor条件があります。私のhtmlにはtd
チェックボックス用のチェックボックスが1つありますが、1つのチェックボックスをクリックすると、テーブル内のすべてのチェックボックスが無効になります。以下は、チェックボックス付きのforループです。
<?php
foreach($this->rows as $record)
{
echo "<tr>";
echo "<td >". $record['firstname'] . "</td>";
echo "<td>".$record['advicetoowners'] . "</td>";
echo"<td>".$record['customdata'] . " <br /> ".$record['reservation'."</td>";
?>
<td class='stylecontent'width='2' >
<input type="checkbox" name="seen" value="" class='chkAll'/>
</td>
<?php
}
?>
私のjQueryは次のとおりです。
$('.chkAll').change(function() {
// This disables all the check box in a table.How to make it to disable only one
$('input:checkbox').attr('disabled', this.checked);
});