高分求教!!
ml457 2003-05-10 05:35:51 高分求教!!
想做一个试题库选题页面(create.jsp),代码如下:
<%@ page contentType="text/html; charset=gb2312" language="java" import="java.sql.*" errorPage="" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>选题</title>
</head>
<%
int pid=1;
if(request.getParameter("pid")!=null)
{ pid=Integer.parseInt(request.getParameter("pid"));
}
%>
<body>
<form action="create.jsp" method="post" name="form1" target="_self" onSubmit="return check();">
<table width="100%" height="90%" border="1">
<tr>
<th height="25" colspan="2" nowrap>选题第 <%=pid%> 步</th>
</tr>
<tr>
<th height="60" rowspan="2" nowrap>请输入第<%=pid%>大题题头</th>
<th width="65%" height="35" nowrap> <input name="test_name" type="text" id="test_name" value="题头" size="45" maxlength="50">
</th>
</tr>
<tr>
<th height="25" nowrap><font color="#0066FF">例如:一、选择题(共10小题,20分)</font></th>
</tr>
<tr>
<td colspan="2"><table width="100%" height="100%" border="1">
<tr>
<th width="20%" nowrap>试题类型</th>
<td width="69%" rowspan="2"> <table width="100%" height="100%" border="1">
<tr>
<th width="35%" nowrap>难度为A</th>
<th width="31%" nowrap> <input name="numA" type="text" id="numA" value="0" size="6" maxlength="2">
道</th>
<th width="34%" nowrap> <input name="scoreA" type="text" id="scoreA" value="0" size="6" maxlength="2">
分</th>
</tr>
<tr>
<th nowrap>难度为B</th>
<th nowrap> <input name="numB" type="text" id="numB" value="0" size="6" maxlength="2">
道</th>
<th nowrap> <input name="scoreB" type="text" id="scoreB" value="0" size="6" maxlength="2">
分</th>
</tr>
<tr>
<th nowrap>难度为C</th>
<th nowrap> <input name="numC" type="text" id="numC" value="0" size="6" maxlength="2">
道</th>
<th nowrap> <input name="scoreC" type="text" id="scoreC" value="0" size="6" maxlength="2">
分</th>
</tr>
</table></td>
<th width="11%" rowspan="2" nowrap> <input type="reset" name="Submit" value="重置">
</th>
</tr>
<tr>
<th nowrap> <select name="test_type" id="test_type">
<option value="0" selected>请选择</option>
<option value="1">选择题</option>
<option value="2">填空题</option>
<option value="3">判断题</option>
<option value="4">名词解释</option>
<option value="5">读成问答</option>
<option value="6">编程题</option>
</select> </th>
</tr>
</table></td>
</tr>
<tr>
<th height="40" colspan="2" nowrap>
<% if((pid-1)>0)
{
%>
<a href=create_paper1.jsp?pid=<%=pid-1%>>上一步</a>
<%
}
%>
|
<% if((pid+1)<7)
{
%>
<input type="hidden" name="numA" value="0">
<a href=create_paper1.jsp?pid=<%=pid+1%> onClick="return check();">下一步</a>
<%
}
%>
<input type="submit" name="Submit2" value="完成">
</th>
</tr>
</table>
</form>
</body>
</html>
想通过点击链接"下一步"对其他题型进行设置,同时将上一步设置存在session中。最后点击“完成”提交当时页面的表单(这时才使用另一个.jsp文件),配合session中存储的内容对数据库进行操作。问题是怎么在点击“下一步”的同时将目前表单对象中的参数存入session.(即如何不经过提交表单来获得其中的参数??)