我试图从列表中只选择一个复选框。这是我正在尝试的代码,但它似乎不起作用。我可以使用 RadioButtonlist 但它不允许我取消选择单选按钮。请告诉我。
$(document).ready(function () {
var checkboxlistid = "#<%= chkLst.ClientID %>";
$(checkboxlistid + " input:checkbox").click(function () {
$(this).attr("checked",""); });
});
<asp:CheckBoxList ID="chkLst" runat="server" RepeatDirection="Horizontal">
<asp:ListItem Value="U">Unknown</asp:ListItem>
<asp:ListItem Value="R">Ref</asp:ListItem>
</asp:CheckBoxList>