二手戴尔台式电脑:谁能帮我添加asp表单验证

来源:百度文库 编辑:杭州交通信息网 时间:2024/05/03 07:44:27
源代码如下
<!--#include file="conn.asp"-->

<html><head>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>

<body>
<form name="form1" method="post" action="save.asp">
<table width="500" border="1" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="62">姓名</td>
<td width="432"><input name="name" type="text" id="name"></td>
</tr>
<tr>
<td>qicq</td>
<td><input name="qicq" type="text" id="qicq"></td>
</tr>
<tr>
<td>email</td>
<td><input name="email" type="text" id="email"></td>
</tr>
<tr>
<td>homepage</td>
<td><input name="homepage" type="text" id="homepage"></td>
</tr>
<tr>
<td>内容</td>
<td><textarea name="content" id="content"></textarea></td>
</tr>
<tr>
<td> </td>
<td><input type="submit" name="Submit" value="提交"></td>
</tr>
</table>
<p>  </p>
</form>
</body>
</html>

<script language="vbscript" for="Submit" event="onclick">
if trim(form1.user.value)="" then
msgbox("用户名不能为空!")
else

if trim(form1.wenti.value)="" then
msgbox("找回密码问题不能为空!")
else
if trim(form1.daan.value)="" then
msgbox("找回密码答案不能为空!")
else
if len(form1.user.value)>=10 then
form1.user.focus
msgbox("你的用户名太长!")

else
if trim(form1.name.value)="" then
msgbox("请输入真实姓名!!")
else
zhi=trim(form1.emai.value)
chang=len(zhi)
if zhi<>"" then
for chang1=1 to chang
if mid(zhi,chang1,1)="@" then
if chang1=1 or chang1=chang then
msgbox("你输入的邮箱不正确!")
else
form1.submit()
end if
end if
next
else
if trim(form1.password1.value)="" or trim(form1.password2.value)="" then
msgbox("请填写密码!")
else
form1.submit()
end if
end if
end if
end if
end if
end if

end if
</script>

你看看嘛,这是我网页的验证!你把你、需要的改一下就行了!