所作网页的提示框出不来,求大神帮忙!
数据库连接正常,就是在不输入用户名和密码的状态下提交本来是要有一个提示框出现的,但是出不来,求大神们帮帮忙!代码如下:
<head>
<style>
body{
background-image:url(w.png);
background-repeat:no-repeat;
background-position:100% 100%}
</style>
<%
flag=request.QueryString("flag")
dim UserName,UserPwd
if len(flag)>0 then
UserName=request.Form("UserName")
UserPwd=request.Form("UserPwd")
if len(UserName)>0 and len(UserPwd)>0 then
dim conn,rs
set conn=server.CreateObject("adodb.connection")
conn.open"dsn=Discuss;uid=sa;pwd=sa"
strSql="SELECT * FROM Users WHERE UserName='"&UserName&"' AND UserPwd='"&UserPwd&"'"
set rs=conn.execute(strSql)
if Not rs.eof then
session("UserName")=rs("UserName")
session("UserId")=rs("UserId")
session("Logo")=rs("Logo")
session("Job")=rs("Job")
session("Passed")=true
conn.close: set conn=nothing
if (UserName="admin") then
response.Redirect("manage.asp")
response.end
else
response.Redirect"main.asp"
response.End
end if
else
Errmsg="用户名或密码错误!"
end if
end if
end if
%>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>登录</title>
<script type="text/javascript" >
function $(UserId){return document.getElementById(UserId);}
function chkfield1(){
if ($("UserName").value==""){
alert("请输入用户名!");$("UserName").focus();
return false;}
if ($("UserPwd").value==""){
alert("请输入密码!");$("UserPwd").focus();
return false;}
}
</script>
</head>
<body >
<br><br>
<p align="center"><font color="#990033" size="15" face="隶书">身份验证</font></p>
<hr color="#993300" width="50%" />
<form method="post" action="denglu.asp?flag=1"name="denglu" onsubmit="return chkfield1()">
<br>
<table id="table2" align="center">
<tr>
<td><p align="center">用户名:</td>
<td><p align="center"><input type="text" name="UserName" size="20"><td>
</tr>
<tr>
<td><p align="center">密 码:</td>
<td><input type="password" name="UserPwd" size="21"></td>
</tr>
<tr>
<td><p align="center"><input type="submit" value="确定" name="B1"></td>
<td><p align="center"><input type="reset" value="重写" name="B2"></td>
</table></form>
<form method="post