首页 > Web开发 > 详细

CheckBoxList用JS实现单元

时间:2014-10-28 12:05:50      阅读:269      评论:0      收藏:0      [点我收藏+]

JS实现单选                       

<script type="text/javascript">
  function CheckSelect() {

    //得到CheckBoxList 的ID

    var tb = document.getElementById("<%=cblHandleContent.ClientID%>");

    //循环得到CheckBoxList 的子集,并控制它的选中状态

    for (var i = 0; i < tb.cells.length; i++) {
      var chk = tb.cells[i].firstChild;
      if (chk != event.srcElement) {
        chk.checked = false;
        }
      }
 }
</script>

后台绑定好的服务器控件

<asp:CheckBoxList onclick="javascript:CheckSelect();" ID="cblHandleContent" RepeatDirection="Horizontal" runat="server" >
</asp:CheckBoxList>          

 

CheckBoxList用JS实现单元

原文:http://www.cnblogs.com/zhumengmeng/p/4056368.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!