帮忙查找以下ASP代码不能验证表单的原因?
<html><head><title>用户注册</title><scriptlanguage="vbscript">optionexplicitdimcntdimcnts...
<html>
<head>
<title>用户注册</title>
<script language="vbscript">
option explicit
dim cnt
dim cntstr
dim titlestr
dim errstr
cnt=int(0)
cntstr=""
sub checkitem(item , title)
if item="" then
cnt=cnt+1
cntstr=cstr(cnt)
errstr=errstr+cntstr+"."+title+chr(13)
end if
end sub
function register_onsubmit()
titlestr="[您请注意]"+"<br>"+"<br>"
errstr=""
call checkitem(document.register.username.value,"用户名不能为空")
call checkitem(document.register.pwd.value,"您必须输入密码")
call checkitem(document.register.conpwd.value,"您必须输入确认密码")
if document.register.pwd.value<>document.register.conpwd.value then
cnt=cnt+1
cntstr=cstr(cnt)
cntstr=errstr+cntstr+"."+您两次输入的密码不相等,请重新输入"+chr(13)
end if
call checkitem(document.register.email.value,"email 不能为空")
if cnt<>0 then
cnt=0
alert(errstr)
register_onsubmit=false
else
register_onsubmit=true
end if
end function
</script>
</head>
<body>
<form methed="post" action="yz.asp" name="register">
<table width="300" border="0" align="center" cellspacing="0">
<tr>
<td height="36" colspan="2" bgcolor="#0066FF">
<div align="center">
<font color="#FFFFFF">用户注册输入信息</font>
</div>
</td>
</tr>
<tr bgcolor="#CCCCCC">
<td width="34%" height="28"><div align="right">用户名:</div></td>
<td width="64%">
<input name="username" type="text">
</td>
</tr>
<tr bgcolor="#CCCCCC">
<td height="28" width="34%"><div align="right">密码:</div>
</td>
<td width="66%">
<input type="password" name="pwd">
</td>
</tr>
<tr bgcolor="#CCCCCC">
<td height="26" width="34%"><div align="right">确认密码:</div></td>
<td width="66%">
<input name="conpwd" type="password">
</td>
</tr>
<tr bgcolor="#CCCCCC">
<td height="28" width="34%"><div align="right">email:</div></td>
<td width="66%">
<input name="email" type="text">
</td>
</tr>
<tr bgcolor="#CCCCCC">
<td width="34%">
<div align="center"><input type="submit" name="submit" value="提交" >
</div>
</td>
<td width="66%">
<div align="center">
<input type="reset" name="S2" value="全部重写" />
</div>
</td>
</tr>
</table>
</form>
</body>
</html> 展开
<head>
<title>用户注册</title>
<script language="vbscript">
option explicit
dim cnt
dim cntstr
dim titlestr
dim errstr
cnt=int(0)
cntstr=""
sub checkitem(item , title)
if item="" then
cnt=cnt+1
cntstr=cstr(cnt)
errstr=errstr+cntstr+"."+title+chr(13)
end if
end sub
function register_onsubmit()
titlestr="[您请注意]"+"<br>"+"<br>"
errstr=""
call checkitem(document.register.username.value,"用户名不能为空")
call checkitem(document.register.pwd.value,"您必须输入密码")
call checkitem(document.register.conpwd.value,"您必须输入确认密码")
if document.register.pwd.value<>document.register.conpwd.value then
cnt=cnt+1
cntstr=cstr(cnt)
cntstr=errstr+cntstr+"."+您两次输入的密码不相等,请重新输入"+chr(13)
end if
call checkitem(document.register.email.value,"email 不能为空")
if cnt<>0 then
cnt=0
alert(errstr)
register_onsubmit=false
else
register_onsubmit=true
end if
end function
</script>
</head>
<body>
<form methed="post" action="yz.asp" name="register">
<table width="300" border="0" align="center" cellspacing="0">
<tr>
<td height="36" colspan="2" bgcolor="#0066FF">
<div align="center">
<font color="#FFFFFF">用户注册输入信息</font>
</div>
</td>
</tr>
<tr bgcolor="#CCCCCC">
<td width="34%" height="28"><div align="right">用户名:</div></td>
<td width="64%">
<input name="username" type="text">
</td>
</tr>
<tr bgcolor="#CCCCCC">
<td height="28" width="34%"><div align="right">密码:</div>
</td>
<td width="66%">
<input type="password" name="pwd">
</td>
</tr>
<tr bgcolor="#CCCCCC">
<td height="26" width="34%"><div align="right">确认密码:</div></td>
<td width="66%">
<input name="conpwd" type="password">
</td>
</tr>
<tr bgcolor="#CCCCCC">
<td height="28" width="34%"><div align="right">email:</div></td>
<td width="66%">
<input name="email" type="text">
</td>
</tr>
<tr bgcolor="#CCCCCC">
<td width="34%">
<div align="center"><input type="submit" name="submit" value="提交" >
</div>
</td>
<td width="66%">
<div align="center">
<input type="reset" name="S2" value="全部重写" />
</div>
</td>
</tr>
</table>
</form>
</body>
</html> 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询