Checkbook全选和多选

        function SelectAll() {
            var checksAll = document.getElementsByName("THECHECKAll");
            var checks = document.getElementsByName("THECHECK");
            var s = "";
            for (var i = 0;i < checks.length;i++) {
                if (checks[i].type == "checkbox") {
                    if (checksAll[0].checked == true) {
                        checks[i].checked = true;
                        if (i==0) {
                            s = checks[i].id;
                        }
                        else {
                            s += "," + checks[i].id;
                        }
                    }
                    else {
                        checks[i].checked = false;
                    }
                }
            }
            //赋值
            document.getElementById("HIGFF_CustomerIDALL").value = s;
        }

        function SelectValue() {
            var count=0;
            var checks = document.getElementsByName("THECHECK");
            var s = "";
            for (var i = 0; i < checks.length; i++) {
                if (checks[i].type == "checkbox") {
                    if (checks[i].checked == true) {
                        if (i == 0) {
                            s = checks[i].id;
                        }
                        else {
                            s += "," + checks[i].id ;
                        }
                        count++;
                    }

                }
            }
            //赋值
            document.getElementById("HIGFF_CustomerIDALL").value = s;
        }

                        <%--   --%>
                        
                        
                            
                                <%--   --%>
                                
序号οnclick="selectID('<%# Eval("CusCode")%>')"客户编号 用户名称
<%#Container.ItemIndex+1%><%#Eval("CusCode")%> <%#Eval("CnName")%>


 
  



你可能感兴趣的:(Checkbook全选和多选)