<%@ page language="java" import="java.sql.*,com.fzyb.xj.cs.report.DBConnection" pageEncoding="gb2312"%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title></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>
<body>
<%
//String driverName = "oracle.jdbc.driver.OracleDriver";
//String url = "jdbc:oracle:thin:@192.168.1.202:1521:orcl";
Connection conn = null;
PreparedStatement ps = null;
ResultSet rs = null;
request.setCharacterEncoding("gb2312");
try{
//Class.forName(driverName).newInstance();
conn = DBConnection.getConnection();
String sql = "select * from bpm_equipment where eqm_name Like '%" + request.getParameter("KeyWords") +"%'";
ps = conn.prepareStatement(sql);
rs = ps.executeQuery();
} catch (Exception e) {
e.printStackTrace();
}%>
<script>
function selectit(){
var form = document.select
var action = event.srcElement.name
for (var i=0;i<form.elements.length;i++){
var e = form.elements[i]
if (e.name == "id")
e.checked =(action=="selectall")?(form.selectall.checked):(!e.checked)
}
}
function submitForm() {
document.select.action="t.jsp";
document.select.submit();
return true;
}
function saveForm() {
document.select.action="saveform.jsp";
document.select.submit();
return true;
}
</script>
<div align="center">
<form name="select" id="select" method="post" action="">
<table border="1" width="60%" id="table1" cellspacing="0" cellpadding="0">
<%
while (rs != null && rs.next()){
%>
<tr>
<td>
<input type="checkbox" name="id" id=<%=rs.getInt("eqm_id")%> value=<%=rs.getInt("eqm_id")%>><%=rs.getString("eqm_name")%>
</td>
</tr>
<%}%>
<tr>
<td>
<input type="checkbox" name="selectall" onclick="selectit()" />全选
<input type="checkbox" name="Inverse" onclick="selectit()" />反选
<input type="submit" name="submitForm" value="提交" onclick="submitForm()"/>
<input type="submit" name="saveForm" value="保存设备组" onclick="saveForm()"/>
</td>
</tr>
</table>
</form>
</div>
</body>
</html>为什么我点提交就是提交不到t.jsp呢?这样写有错吗?
解决方案 »
- 有没有这样一种自动化工具?
- hibernet 保存一个String list时的问题
- 我的服务器是linux+jboss4.0 我改端口后 域名访问不了怎么办呢
- 关于displaytag的两个问题
- 如何将数据库中的路径读入到type=file的文本框中
- 帮学校做网站,快交任务了,焦急中!!50分求教。
- 新手学习Servlet的疑问
- double的数据怎么样四舍五入了??
- 莫名其妙:weblogic7+sqlserver2000 jsp调用连接池出错... 在线等待,解决立即给分
- 如何不让tomcat列表显示啊
- struts2 tree 前台显示空白???
- Save could not be completed各位高手帮帮忙,在线等
中的type类型改成button <input type="button" name="submitForm" value="提交" onclick="submitForm()"/>
function submitForm(){
document.select.action=a.jsp;
}function saveForm(){
document.select.action=b.jsp;
}
<form name="select" id="select" method="post" action="" onsubmit = "return(submitForm());">
<input type="submit" name="submitForm" value="提交"/>
直接 <a href="t.jsp"><input type="button" name="button" value="提交"></a>
我的错误是submit的名字和js函数的名字重复了,谢谢大家