<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head> <base href="http://user-20160821pd:8088/com.jdbc2/"> <title>My JSP 'index.jsp' starting page</title> <meta http-equiv="pragma" content="no-cache"> <meta http-equiv="cache-control" content="no-cache"> <meta http-equiv="expires" content="0"> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"> <meta http-equiv="description" content="This is my page"> <!-- <link rel="stylesheet" type="text/css" href="styles.css"> --> </head> <script type="text/javascript"> function chkall() { //alert(1); var chkall=document.getElementById("chksall"); var chks=document.getElementsByName("chks"); if(chkall.checked){ for(var i=0;i<chks.length;i++){ chks[i].checked=true; } }else{ for(var i=0;i<chks.length;i++){ chks[i].checked=false; } } } function delchk() { var ids=""; var chks1=document.getElementsByName("chks"); for(var i=0;i<chks1.length;i++){ if(chks1[i].checked){ ids += chks1[i].value+","; } } alert(ids); window.location.href="delall.jsp?ids="+ids; } </script> <style type="text/css"> td { width: 150px } </style> <body> <h3>员工管理列表</h3> <form action="select.jsp" method="post"> 员工序号:<input type="text" name="nums"> 员工姓名:<input type="text" name="ename"> <input type="submit" value="查询"> </form> <a href="javascript:if(window.confirm('是否批量删除')){delchk();}">批量删除</a> <a href="edit.jsp?modify=1">新增</a> <table> <tr> <td><input type="checkbox" id="chksall" onchange="chkall()"> </td> <td>序号</td> <td>姓名</td> <td>操作</td> </tr> <!-- EL语言 --> <tr> <td><input type="checkbox" name="chks" value="1004"> </td> <td>1004</td> <td>大乔</td> <td> <a href="modify.jsp?modify=0 &&nums=1004 &&ename=大乔">修改</a> <a href="del.jsp?num=1004 ">删除</a> </td> </tr> <tr> <td><input type="checkbox" name="chks" value="1005"> </td> <td>1005</td> <td>小乔</td> <td> <a href="modify.jsp?modify=0 &&nums=1005 &&ename=小乔">修改</a> <a href="del.jsp?num=1005 ">删除</a> </td> </tr> <tr> <td><input type="checkbox" name="chks" value="2006"> </td> <td>2006</td> <td>悟空</td> <td> <a href="modify.jsp?modify=0 &
转载于:https://www.cnblogs.com/chengxuy/p/6017579.html