如何禁用表格行中的单个复选框?我有一个phtml文件的条件。我的html有一个td
为我的复选框,但如果我点击一个复选框,它会禁用表中的所有复选框。下面是我的for循环复选框。jquery禁用表格中的所有复选框
<?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);
});
超级帮助我。谢谢你,亲爱的弟弟 – Indira
欢迎@Indira – rahul