how to make an checkboxlist select only one item selected
i am using an checkboslist binding to a datatable. but here i need to make user select only one item 开发者_高级运维selected from checkbox list is there way we can aachive this
either JQuery, javascript, c# thank you
If the user is only allowed to select one item from a list, you should use radio buttons instead of checkboxes.
UPDATE:
If you have to use checkboxes then you can use the following code:
$("#myform :checkbox").click(function(){
$("#myform input:checked").attr("checked","");
$(this).attr("checked","checked");
});
精彩评论