簡體   English   中英

在檢查其他復選框的同一行中的其他單元格時,禁用行中html表格單元格中的復選框

[英]Disabling a checkbox in a html table cell in row on checking other check box other cell in the same row

我想在MVC中的同一行中選中其他復選框時禁用html表格單元格中的復選框。

控制器代碼如下:

<table id='myTable1'>
<th>Buy</th>

<th>Sell</th>

<tbody>

@foreach (var item in Model)

 {
<td>
<input id="assignChkBx" name="chk" type="checkbox" value="@item.itemId">
</td>

 <td>
<input id="Buy" name="BuyPO" type="checkbox"  value="@item.itemId"/>
</td>`

}

</tbody>


</table>

當我選擇,購買時,我想禁用賣出,反之亦然。請幫助... TIA ..

請考慮使用單選按鈕。 如果您為它們指定相同的名稱(但ID不同),它們將自動檢查並取消選中。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM