如何禁用表格行中的單個複選框?我有一個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