首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > ASP >

[]表单没有被提交

2012-03-05 
[求助]表单没有被提交!--#includefile conn.asp --scriptlanguagejavascriptfunctioncheck(){if(d

[求助]表单没有被提交
<!--#include   file= "conn.asp "-->
<script   language=javascript>
function   check()
{if(document.form1.student.value== " ")
{alert( "请输入用户名 ");
document.form1.student.focus();
return   false;}
if(document.form1.pwd.value== " ")
{alert( "请输入用户密码 ");
document.form1.pwd.focus();
return   false;}
document.form1.ctype.vlaue= "add ";
document.form1.submit();
}
</script>
<%
session.Timeout=125
if   trim(request( "ctype "))= "add "   then
session( "student ")= " "
session( "classes ")= " "
session( "id ")= " "
session( "number ")= " "
session( "sex ")= " "
sql= "select   *   from   student   where   studentname= ' "&trim(request( "student "))& " '   and   studentpassword= ' "&trim(request( "pwd "))& " ' "
set   rs=conn.execute(sql)
if   rs.eof   then
%>
<script   language=javascript>
alert( "无此学员!请先注册 ");
</script>
<%
else
session( "student ")=rs( "studentname ")
session( "classes ")=rs( "class ")
session( "number ")=rs( "studentnumber ")
session( "sex ")=rs( "sex ")
session( "timer ")=now
%>
<script   language=javascript>
var   now=new   date()
window.navigata( "index.asp?time= "+now.getTime());
</script>
<%   end   if
end   if   %>
<html>
<head>
<meta   http-equiv= "Content-Language "   content= "zh-cn ">
<meta   name= "GENERATOR "   content= "Microsoft   FrontPage   6.0 ">
<meta   name= "ProgId "   content= "FrontPage.Editor.Document ">
<meta   http-equiv= "Content-Type "   content= "text/html;   charset=gb2312 ">
<title> 网上考试系统 </title>
<link   rel= "stylesheet "   type= "text/css "   href= "css.css ">

<style   type   = "text/css ">
<!-
a{text-decoration:none}
a:link{text-decoration:none}
a:hover{text-decoration:none}
a:visited{text-decoration:none}
->
</style>

</head>
<body>
<!--#include   file= "top.htm "-->
<table   border= "0 "   cellpadding= "4 "   style= "border-collapse:   collapse "   bordercolor= "#111111 "   width= "778 "   height= "100 ">
    <tr>
        <td   align= "center ">
        <table   border= "0 "   width= "100% "   id= "table1 ">
    <tr>
      <td>   </td>
      <td>
<form   name=form1   action= " ">   <input   type= "hidden "   name= "ctype ">
<table   border= "0 "   bordercolor= "#111111 "   width= "778 "   height= "100 ">  
<tr>


<td   align= "center ">
<table   border= "0 "   width= "100% ">
<table   border= "0 "   width= "300 "   >
<tr>
<td   width= "100 "   align= "right "> 用户名: </td>
        <td   width= "200 ">  
<input   type= "text "   name= "student "   size= "20 "> </td> </tr>
<tr>
<td   width= "100 "   align= "right "> 密码: </td>
          <td   width= "200 ">  
<input   type= "password "   name= "pwd "   size= "20 "> </td> </tr>
<tr   align= "center ">
<td   align= "center "> <input   type= "button "   value= "提交 "   name= "b1 "   onclick= "check() ">
<input   type= "reset "   value= "重置 "   name= "b2 "   > </td> </tr>
<tr   >
<td   width= "400 "> <a   href= "register.asp "> 新学生注册 </a> </td> </tr>
<tr>
<td> <a   href= "admin/index.asp "> 后台管理入口 </a> </td>
<td   width= "299 "   height= "289 "> <img   border= "0 "   src= "images/web213.jpg "> </td> </tr>
</table>
</td>  
    </tr>  
</table>  
</body>
</html>

不知道哪里出错了,没有 "请输入用户名 "的提示?


[解决办法]
1.没有 </form>

2.{alert( "请输入用户密码 ");
^这里是全角括号
改成{alert( "请输入用户密码 ");

3. <input type= "button " value= "提交 " name= "b1 " onclick= "check() ">
改成 <input type= "button " value= "提交 " name= "b1 " onclick= "return check(); ">

热点排行
Bad Request.