找回密码
 注册
搜索
热搜: 回贴
  • 前程无忧官网首页 有什么好的平台可以
  • 最新的销售平台 互联网营销的平台有哪
  • 制作网页的基本流程 网页制作和网页设
  • 【帝国CMS】输出带序号的列表(数字排
  • 网站建设公司 三一,中联,极东泵车的
  • 织梦 建站 织梦网站模版后台怎么更改
  • 云服务官网 哪些网站有免费的简历模板
  • 如何建网站要什么条件 建网站要用什么
  • 吉林市移动公司电话 吉林省退休人员网
  • 设计类毕业论文 网站设计与实现毕业论
查看: 50|回复: 3

[求助]表单没有被提交

[复制链接]
发表于 2010-1-8 00:57:56 | 显示全部楼层 |阅读模式 IP:江苏扬州
<!--#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>
不知道哪里出错了,没有"请输入用户名"的提示?
发表于 2010-1-8 00:57:59 | 显示全部楼层 IP:江苏扬州
非常感谢,找到原因了,是"("请输入用户密码");"右括号的问题
回复

使用道具 举报

发表于 2010-1-8 00:58:02 | 显示全部楼层 IP:江苏扬州
  1. <script language=javascript>
  2. function check(){
  3. if(document.form1.student.value==""){
  4. alert("请输入用户名");
  5. document.form1.student.focus();
  6. }
  7. if(document.form1.pwd.value==""){
  8. alert("请输入用户密码");
  9. document.form1.pwd.focus();
  10. }
  11. document.form1.ctype.vlaue="add";
  12. document.form1.submit();
  13. }
  14. </script>
  15. <form name=form1 action="">
  16. <input type="hidden" name="ctype">
  17. <input type="text" name="student" size="20">
  18. <input type="password" name="pwd" size="20">
  19. <input type="button" value="提交" name="b1" onclick="check()">
  20. <input type="reset" value="重置" name="b2" >
  21. </form>
复制代码

没问题啊
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|小黑屋|最新主题|手机版|微赢网络技术论坛 ( 苏ICP备08020429号 )

GMT+8, 2024-9-30 05:29 , Processed in 0.175405 second(s), 11 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表