department_select_chk.aspx
资源名称:web.rar [点击查看]
上传用户:xrffrp
上传日期:2022-03-25
资源大小:22155k
文件大小:3k
源码类别:
OA系统
开发平台:
ASP/ASPX
- <%@ Page Language="C#" AutoEventWireup="true" CodeFile="department_select_chk.aspx.cs" Inherits="web_personnel_department_department_select_chk" %>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml" >
- <head runat="server">
- <title>无标题页</title>
- <link href="../../../css/style.css" rel="stylesheet" type="text/css" />
- <script language="javascript" type="text/javascript">
- function check(id)
- {
- var current = document.getElementById("chk"+id);
- var temp1 = document.getElementsByTagName("input");
- for(var i=1; i<temp1.length; i++)
- {
- if(temp1[i].type == "checkbox" && temp1[i].parent==id)
- {
- temp1[i].checked = current.checked;
- var temp2 = document.getElementsByTagName("input");
- for(var j=1; j<temp2.length; j++)
- {
- if(temp2[j].type == "checkbox" && ("chk"+temp2[j].parent)==temp1[i].id)
- {
- temp2[j].checked = current.checked;
- var temp3 = document.getElementsByTagName("input");
- for(var k=1; k<temp3.length; k++)
- {
- if(temp3[k].type == "checkbox" && ("chk"+temp3[k].parent)==temp2[j].id)
- {
- temp3[k].checked = current.checked;
- }
- }
- }
- }
- }
- }
- }
- function sum()
- {
- var flag = "0";
- var menus = "";
- for(var i=0; i<1000; i++)
- {
- if(document.getElementById("chk"+i)!=null)
- {
- if(document.getElementById("chk"+i).checked)
- {
- flag = "1"
- menus = menus+"" + i + ",";
- }
- }
- }
- if(flag == "0")
- {
- alert("請至少選擇一個部門");
- return false;
- }
- document.all.DepartmentIds.value=menus.substring(0,menus.length-1);
- return true;
- }
- </script>
- </head>
- <body>
- <form id="form1" runat="server">
- <div>
- <asp:Table ID="TblDepartment" runat="server" BorderWidth="1px">
- </asp:Table>
- <br />
- <center><asp:HiddenField ID="DepartmentIds" runat="server"></asp:HiddenField>
- <asp:Button ID="BtnOk" runat="server" Text="確定" OnClick="BtnOk_Click" OnClientClick="return sum()" /></center>
- </div><br />
- </form>
- </body>
- </html>