String[] tempDetainTypeArray=request.getParameterValues("复选框名称");
这样可以取得一个选中的复选框的值。
这样可以取得一个选中的复选框的值。
解决方案 »
- 求助:上传文件到MySQl出现乱码
- tomcat连接Oracle数据库问题
- myeclipse 用spring 的难看
- 第一次散分!JSP/Servlet页面重定向的问题
- 初用jspsmartupload组件,请指教
- 大家谁知道tomcalt5.0的server.xml文件里为什么没有context这个元素,从而导致我无法更改属性reloadble
- JSP中的数据类型转换 急急急急!!!!!!!!
- how to close a session object?
- JDK中没有javax.Servlet这个包吗?
- jsp在什么需求时要用ActiveX,如何使用?给个例子看看!65分奉上!!!!
- jsp好在哪里呢??我认为好像不如asp
- 端口号隐藏????
<%@ page contentType="text/html;charset=gb2312" %>
<html>
<%@ page language="java"%>
<%@ page import="java.sql.*"%>
<head>
<title>V2</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<jsp:useBean id="work2" scope="page" class="V2.Dbopen"/>
<%
ResultSet rs=work2.executeQuery("select * from t_contact where user_name='wei' order by name");
%>
<form name="form1" method="post">
<table width="75%" border="0" align="center">
<tr>
<td>
<table width="100%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#CCCCCC">
<tr align="center" valign="middle">
<td width="10%"><strong><font size="2" face="宋体">操作</font></strong></td>
<td width="15%"><strong><font size="2" face="宋体">联系人姓名</font></strong></td>
<td width="50%"><strong><font size="2" face="宋体">工作单位</font></strong></td>
<td width="25%"><strong><font size="2" face="宋体">职务</font></strong></td>
</tr>
<% while(rs.next()){ %>
<tr align="center" valign="middle">
<td width="10%"><input name="sendChoice" type="checkbox" value="checkbox"></td>
<%
String[] tempDetainTypeArray=request.getParameterValues("sendChoice");
out.print(tempDetainTypeArray);
%>
<td width="15%"> <div align="center"> <font size="2" face="宋体">
<% out.print(rs.getString("name"));%></font></div></td>
<td width="50%"> <div align="center"> <font size="2" face="宋体">
<%out.print(rs.getString("corp_name"));%></font></div></td>
<td width="25%"> <div align="center"> <font size="2" face="宋体">
<%out.print(rs.getString("position"));%></font></div></td>
</tr>
<%
}
rs.close();
%>
</table>
<table width="100%" border="0">
<tr>
<td><input name="SelectAll" type="checkbox" onClick="Select_All()">
<font size="2" face="宋体"><strong>全选</strong></font>
<input type="submit" name="Submit" value="Send"></td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</body>
</html>
<%
String[] tempDetainTypeArray=request.getParameterValues("sendChoice");
out.print(tempDetainTypeArray);
%>
来接收用户选中的记录的id,然后将选中的信息插入到别一个表中。