开发者

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");
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜