<!DOCTYPE html> <html> <head> <title>用户管理</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script src="http://libs.baidu.com/jquery/1.9.1/jquery.min.js"></script> <style> </style> <script> //全选、全反选 function doSelectAll(){ $("input[name=selectedRow]").prop("checked",$("#selAll").is(":checked")); } </script> </head> <body> <form name="form1" action="" method="post" enctype="multipart/form-data"> <div class="t_list" style="margin:0px;border:0px none;"> <table width="100%" border="0"> <tr class="t_tit"> <td width="30" align="center"><input type="checkbox" id="selAll" onclick="doSelectAll()" /></td> <td width="140" align="center">用户名</td> <td width="140" align="center">账号</td> <td width="160" align="center">所属部门</td> <td width="80" align="center">性别</td> <td align="center">电子邮箱</td> <td width="100" align="center">操作</td> </tr> <!--循环显示用户列表--> <tr bgcolor="f8f8f8"> <td align="center"><input type="checkbox" name="selectedRow" value="" /></td> <td align="center">xxx</td> <td align="center">xxx</td> <td align="center">xxx</td> <td align="center">xxx</td> <td align="center">xxx</td> <td align="center"> <a href="javascript:doEdit(id)">编辑</a> <a href="javascript:doDelete(id)">删除</a> </td> </tr> <tr bgcolor="f8f8f8"> <td align="center"><input type="checkbox" name="selectedRow" value="" /></td> <td align="center">xxx</td> <td align="center">xxx</td> <td align="center">xxx</td> <td align="center">xxx</td> <td align="center">xxx</td> <td align="center"> <a href="javascript:doEdit(id)">编辑</a> <a href="javascript:doDelete(id)">删除</a> </td> </tr> <tr bgcolor="f8f8f8"> <td align="center"><input type="checkbox" name="selectedRow" value="" /></td> <td align="center">xxx</td> <td align="center">xxx</td> <td align="center">xxx</td> <td align="center">xxx</td> <td align="center">xxx</td> <td align="center"> <a href="javascript:doEdit(id)">编辑</a> <a href="javascript:doDelete(id)">删除</a> </td> </tr> </table> </div> </form> </body> <!-- 我们在UserAction中加入“private String[] selectedRow; ”参数和get与set方法, 用来接收从界面上选定的需要删除的信息的id的集合,之后修改批量删除方法: --> </html>
原文地址:https://www.cnblogs.com/moonsoft/p/10358316.html
时间: 2024-10-01 01:50:34