主题:表单验证问题
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<link href="css.css" rel="stylesheet" type="text/css" />
<%
function submitcheck(frm)
if frm.user.value="" Then
msgbox("请输入用户名")
submitcheck=false
end if
if frm.pass1.value="" or frm.pass2.value=""Then
msgbox("请输入密码")
submitcheck=false
end if
if frm.pass1.value<>frm.pass2.value then
msgbox("两次输入的密码不一样!")
submitcheck=false
end if
if instr(1,frm.mail.value,"@")=0 or instr(1,frm.mail.value,".")=0 then
msgbox("电子邮件不正确!")
submitcheck=false
end if
end function
%>
</head>
<body>
<form id="form1" name="form1" method="post" action="regsul.asp" onSubmit="return submitcheck()">
<table width="600" border="0" align="center" cellpadding="2" cellspacing="5">
<tr>
<td width="200"><div align="right">用户名:</div></td>
<td><label>
<input type="text" name="user" />
</label></td>
</tr>
<tr>
<td width="200"><div align="right">昵称:</div></td>
<td><label>
<input type="text" name="nn" />
</label></td>
</tr>
<tr>
<td width="200"><div align="right">密码:</div></td>
<td><label>
<input type="password" name="pass1" />
</label></td>
</tr>
<tr>
<td width="200"><div align="right">确认密码:</div></td>
<td><label>
<input type="password" name="pass2" />
</label></td>
</tr>
<tr>
<td width="200"><div align="right">E-mail:</div></td>
<td><label>
<input type="text" name="mail" />
</label></td>
</tr>
<tr>
<td width="200" colspan="2"><div align="center">
<label align="center">
<input type="submit" name="Submit" value="提交" />
</label>
<label align="center">
<input type="reset" name="Submit2" value="重置" />
</label>
</div></td>
</tr>
</table>
</form>
</body>
</html>
为什么不进行验证就直接转到regsul.asp了?function submitcheck(frm)有问题吗?