日期:2014-05-17  浏览次数:20760 次

jsp问题,找不到错误
InputStuMessage.jsp

<%@ page contentType="text/html;charset=gb2312" %>
<html><head>
<script language="javascript" >
function CheckSubmit(){
if(document.nform.name.value=""){
alert("请输入姓名!");
document.nform.name.focus();
return false;
}
if(document.nform.stunumber.value=""){
alert("请输入学号!");
document.nform.stunumber.focus();
return false;
}
if(document.nform.sclass.value=""){
alert("请输入班级!");
document.nform.sclass.focus();
return false;
}
}
</script>

</head>
<body>
<div align=center>
<p>欢迎你,请输入学生的相关信息:</p>
<form action="ShowMessage.jsp" method="post" name="nform">
<table border="0" cellspacing="1" cellpadding="1">
<tr><td>
姓名:<input type=text name="name" size="20">
</td></tr>
<tr><td>
学号:<input type=text name="stunumber" size="20">
</td></tr>
<tr><td>
性别:<input type=radio name="gender" value="m" checked>男
      <input type=radio name="gender" value="f"checked>女
</td></tr>
<tr><td>
班级:<input type=text name="sclass" size="20">
</td></tr>
<tr><td>
专业:<select name="speciality">
<option value="1" selected>计算机应用</option>
<option value="2" >计算机网络</option>
<option value="3" >计算机结构</option>
</select>
</td></tr>
<tr><td>
<input type="submit" name="submit" value="确定" onclick="return CheckSubmit();">
<input type="reset" name="reset" value="重新填写" >
</td></tr>

</table>

</form> 
</div>
</body>
</html>



showMessage.jsp



<%@ page contentType="text/html;charset=gb2312" %>
<html><head>
<script language="javascript" >
function CheckSubmit(){
if(document.nform.name.value=""){
alert("请输入姓名!");
document.nform.name.focus();
return false;
}
if(document.nform.stunumber.value=""){
alert("请输入学号!");
document.nform.stunumber.focus();
return false;
}
if(document.nform.sclass.value=""){
alert("请输入班级!");
document.nform.sclass.focus();
return false;
}
}
</script>

</head>
<body>
<div align=center>
<p>欢迎你,请输入学生的相关信息:</p>
<form action="ShowMessage.jsp" method="post" name="nform">
<table border="0" cellspacing="1" cellpadding="1">
<tr><td>
姓名:<input type=text name="name" size="20">
</td></tr>
<tr><td>
学号:<input type=text name="stunumber" size="20">
</td></tr>
<tr><td>
性别:<input type=radio name="gender" value="m" checked>男
      <input type=radio name="gender" value="f"checked>女
</td></tr>
<tr><td>
班级:<input type=text name="sclass" size="20">
</t