控制一组多选框实现单选

 

<!--Jquery代码-->

$(':checkbox').click(function() {
            var $this = $(this);
            if ($this.parent().hasClass('radio')) {
            var checkboxs = $this.parent().children(':checkbox');
            checkboxs.each(function(i) {
              if (i != checkboxs.index($this)) {
                     $(this).removeAttr('checked');
              }
         });
}

});

<asp:CheckBoxList runat="server" ID="chl_EquipMode" RepeatDirection="Horizontal" AutoPostBack="false" CssClass="radio">
    <asp:ListItem Value="备案">备案</asp:ListItem>
    <asp:ListItem Value="出口前">出口前</asp:ListItem>
    <asp:ListItem Value="报核前 ">报核前 </asp:ListItem>
</asp:CheckBoxList>

posted on 2016-03-09 16:48  小小程序猿儿  阅读(222)  评论(0编辑  收藏  举报

导航