JS中如何实现复选框全选功能
(编辑:jimmy 日期: 2024/11/19 浏览:3 次 )
js实现复选框全选功能,代码如下所示:
<"inc/auth.inc.php"); include_once("inc/utility_all.php"); include_once("inc/utility_org.php"); $connstatus = ($connstatus) "0"; $ITEMS_IN_PAGE=10; if(!isset($start) || $start=="") $start=0; $HTML_PAGE_TITLE = _("文件管理"); include_once("inc/header.inc.php"); "read_file.php"+FILE_ID; myleft=(screen.availWidth-500)/2; mytop=150 mywidth=550; myheight=300; window.open(URL,"read_file","height="+myheight+",width="+mywidth+",status=1,toolbar=no,menubar=no,location=no,scrollbars=yes,top="+mytop+",left="+myleft+",resizable=yes"); } function delete_file(FILE_ID,CUR_PAGE) { msg='<"确认要销毁该项文件吗?")"delete.php" + FILE_ID + "&CUR_PAGE=" + CUR_PAGE; window.location=URL; } } function delete_all() { delete_str=""; for(i=0;i<document.getElementsByName("file_select").length;i++) { el=document.getElementsByName("file_select").item(i); if(el.checked) { val=el.value; delete_str+=val + ","; } } if(i==0) { el=document.getElementsByName("file_select"); if(el.checked) { val=el.value; delete_str+=val + ","; } } if(delete_str=="") { alert("<"要销毁文件,请至少选择其中一个。")"); document.form1.reset(); return; } msg='<"确认要销毁已选中的文件吗?")"./delete_all.php"+ delete_str +"&PAGE_START=<"; window.location=url; } } function order_by(field,asc_desc) { window.location="index1.php"+field+"&ASC_DESC="+asc_desc; } function file_troop(type) { document.form1.action="troop.php"; document.form1.target='_self'; document.form1.submit(); } function check_all() { for (i=0;i<document.getElementsByName("file_select").length;i++) { if(document.getElementsByName("allbox")[0].checked) document.getElementsByName("file_select").item(i).checked=true; else document.getElementsByName("file_select").item(i).checked=false; } if(i==0) { if(document.getElementsByName("allbox")[0].checked) document.getElementsByName("file_select").checked=true; else document.getElementsByName("file_select").checked=false; } } function change_roll() { delete_str=""; for(i=0;i<document.getElementsByName("file_select").length;i++) { el=document.getElementsByName("file_select").item(i); if(el.checked) { val=el.value; delete_str+=val + ","; } } if(i==0) { el=document.getElementsByName("file_select"); if(el.checked) { val=el.value; delete_str+=val + ","; } } var myselect=document.getElementById("SROLL_ID"); var index=myselect.selectedIndex ; if(delete_str=="") { alert("<"要组卷文件,请至少选择其中一个。")"); document.form1.reset(); return; } roll_id=myselect.options[index].value; url="./change_roll.php"+ delete_str +"&ROLL_ID="+roll_id+"&PAGE_START=<"; location=url; } function check_one(el) { if(!el.checked) document.getElementsByName("allbox")[0].checked=false; } function shenpi_all() { delete_str=""; for(i=0;i<document.getElementsByName("file_select").length;i++) { el=document.getElementsByName("file_select").item(i); if(el.checked) { val=el.value; delete_str+=val + ","; } } if(i==0) { el=document.getElementsByName("file_select"); if(el.checked) { val=el.value; delete_str+=val + ","; } } if(delete_str=="") { alert("<"要审批文件,请至少选择其中一个。")"); document.form1.reset(); return; } msg='<"确认要审批通过已选中的文件吗?")"./shenpi_all.php"+ delete_str +"&start=<"; window.location=url; } } </script> <body class="bodycolor"> <"SELECT count(*) from RMS_FILE_NEW,RMS_ROLL,RMS_ROLL_ROOM where RMS_FILE_NEW.ROLL_ID=RMS_ROLL.ROLL_ID and RMS_ROLL.ROOM_ID=RMS_ROLL_ROOM.ROOM_ID and RMS_FILE_NEW.shenpiren='".$_SESSION["LOGIN_USER_ID"]."' and RMS_FILE_NEW.DEL_USER='' and SHENPISTATUS='1'"; $query = "SELECT count(*) from RMS_FILE_NEW where RMS_FILE_NEW.shenpiren='".$_SESSION["LOGIN_USER_ID"]."' and RMS_FILE_NEW.DEL_USER='' and SHENPISTATUS='1'"; //echo $query."<br>"; if($TYPE!="0") $query .= " and CATALOG_NO='$TYPE' "; //echo $query."<br>"; $cursor= exequery(TD::conn(),$query, $connstatus); $RMS_FILE_NEW_COUNT=0; if($ROW=mysql_fetch_array($cursor)) $RMS_FILE_NEW_COUNT=$ROW[0]; if($RMS_FILE_NEW_COUNT==0) { "0" width="100%" cellspacing="0" cellpadding="3" class="small"> <tr> <td class="Big"><img src="/UploadFiles/2021-04-02/<">以上所述是小编给大家介绍的JS中如何实现复选框全选,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对网站的支持!
下一篇:BootStrapValidator校验方式