主题:求助[表单提交]
<script language=vbscript>
<!--
sub tijiao_onclick()
if len(login.userid.value)<3 then
msgbox"用户名太短,请选择一个大于3的名字"
login.userid.select
exit sub
end if
if instr(trim(login.userid.value),"")>1 then
msgbox"用户名中请不要加入空格"
login.userid.select
exit sub
end if
if len(login.userpw.value)<4 then
msgbox"密码太短,请选择一个长度大于4的密码"
login.userpw.select
exit sub
end if
if login.userpw.value<>login.verifypw.value then
msgbox "确认密码和密码不同,请确认"
login.userpw.value=""
login.verifypw.value=""
login.userpw.select
exit sub
end if
if login.name.value="" then
msgbox"为了更好的为您服务,请输入您的名字"
login.name.select
exit sub
end if
if login.idnumber.value="" or not isnumeric(login.idnumber.value) or len(login.idnumber.value)<>15 and len(login.idnumber.value)<>18 then
msgbox"请正确输入您的身份证号码"
login.idnumber.select
exit sub
end if
if login.age.value="" or not isnumeric(login.age.value) then
msgbox"请正确输入您的年龄"
login.age.select
exit sub
else
if cint(login.age.value)<12 then
msgbox"年龄输入范围有错"
login.age.select
exit sub
end if
if login.address.value="" then
msgbox"请输入您的详细联系地址"
login.address.select
exit sub
end if
if len(login.zipcode.value)<>6 or NOT isnumeric(login.zipcode.value) then
msbgox"邮政编码输入有误,请更正!"
login.zipcode.select
exit sub
end if
if not login.phone.value="" then
if isnumeric(login.phone.value) then
if len(login.phone.value)>7 or left(login.phone.value,1)="-" or left(login.phone.value,1)="+" then
msbbox"电话号码输入有误"
login.phone.select
exit sub
end if
else
pos=instr(login.phone.value,"-")
len_phone=len(login.phone.value)
if pos>1 and pos<len-phone then
lef=left(login.phone.value.pos-1)
rig=right(login.phone.value,len_phone-pos)
if not isnumeric(lef) or not isnumeric(rig) or len(rig)<5 then
msgbox"电话号码输入有误"
login.phone.select
exit sub
end if
end if
end if
if login.email.value="" then
msgbox"为了与您方便的联系,请e-mail地址"
login.email.select
exit sub
else
if not right(login.email.value,4)=".com" and not right(login.email.value,4)=".net" and not right(login.email.value,3)=".cn" or instr(login.email.value,"@")<=1 or instr(login.email.value,"@.") then
msgbox"请正确的输入您的E-mail"
login.email.select
exit sub
end if
end if
login.submit
end sub
-->
</script>
<html>
<head>
<meta http-equiv="content-language" content="THL">
<meta http-equiv="content-type" content="text/html;charset=gb2312">
<style type="text/css">
<!--
.style5{font-size:12}
.style6{color:#ff0000}
-->
</style>
</head>
<body leftmargin="50" class="class2">
<span class="style5">您的位置:注册页面 注意:带*的项目为必填项目 </span>
<hr />
<form action="cutadd.asp" method="post" name="form1" class="style5" id="form1">
<p>会 员 名:
<input name="userid" type="text" id="userid" size="20" maxlength="20" />
*(用户名长度为3-8位)</p>
<p>密 码:
<input name="userpw" type="password" id="userpw" size="20" maxlength="20" />
*(密码长度为4-8位)</p>
<p>确认密码:
<input name="verifypw" type="password" id="verifypw" size="20" maxlength="20" />
*</p>
<p>您的姓名:
<input name="name" type="text" id="name" size="20" maxlength="20" />
*</p>
<p>身份证号:
<input name="idnumber" type="text" id="idnumber" size="35" maxlength="20" />
*</p>
<p>性 别:
<input type="radio" name="sex" value="男" />
男
<input type="radio" name="sex" value="女" />
女
*</p>
<p>您的年龄:
<input name="age" type="text" id="age" size="5" maxlength="5" />
*</p>
<p>详细地址:
<input name="address" type="text" id="address" size="35" maxlength="50" />
*</p>
<p>邮政编码:
<input name="zipcode" type="text" id="zipcode" size="10" maxlength="6" />
*</p>
<p>电话号码:
<input name="phone" type="text" id="phone" size="20" maxlength="20" />
</p>
<p>电子邮箱:
<input name="email" type="text" id="email" size="20" maxlength="20" />
*</p>
<p>
<input type="button" name="tijiao" value="提交" >
<input type="reset" name="Submit2" value="重置">
</p>
</form>
<p> </p>
</body>
</html>
[em1][em2][em2]