找回密码
 注册
搜索
热搜: 回贴
  • 前程无忧官网首页 有什么好的平台可以
  • 最新的销售平台 互联网营销的平台有哪
  • 制作网页的基本流程 网页制作和网页设
  • 【帝国CMS】输出带序号的列表(数字排
  • 网站建设公司 三一,中联,极东泵车的
  • 织梦 建站 织梦网站模版后台怎么更改
  • 云服务官网 哪些网站有免费的简历模板
  • 如何建网站要什么条件 建网站要用什么
  • 吉林市移动公司电话 吉林省退休人员网
  • 设计类毕业论文 网站设计与实现毕业论
查看: 143|回复: 1

我的代码错在那里啊!!

[复制链接]
发表于 2009-9-15 01:04:51 | 显示全部楼层 |阅读模式 IP:江苏扬州
我想在注册的时候如果输入的用户名字小于3的时候用IF 和 msgbox 提示注册用户名字不能小于长度3
为什么错误!!!请指教下!!!

<script language="vbscript">
<!--
sub submit_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.userpassword.value)<4 then
msgbox"密码太短,请选择有一个长度大于4的密码"
login.userpassword.select
exit sub
end if
if login.userpossword1.value<>login.possword.value then
msgbox"确认密码和密码不同,请确认"
login.userpassword.value=""
login.userpassword1.value=""
login.userpassword.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
msbox "请输入你的身份证号码"
login.idnumber.select
exit sub
end if
if login.age.value="" or Not isnumeric(login.age.value) then
msbox "请正确输入你的年龄"
login.age.select
exit sub
else
if cint(login.age.value)<12 then
msbox "年龄输入范围有错"
login.age.select
exit sub
else
end if
if login.address.value="" then
msbox "请输入你的详细联系地址"
login.age.select
exit sub
else
end if
-->
</script>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<style type="text/css">
<!--
.style5{font-size: 14px}
.style6{ color: #FF0000}
-->
</style>
</head>

<body leftmargin="20">
<span class="style5"><font color="#FF0000">你的位置:注册页面;  注意:带*的项目为必填项目</font></span>
<br>
<hr color="#999933" size="1" />
<br>
<form name="login" method="post" action="reg.asp" onsubmit="return chkform(this)">
<table width="617" border="1" align="center" cellpadding="0" cellspacing="0">
<tr>
    <td colspan="2" align="center" scope="col" height="30" bgcolor="#999999">*_*欢迎进入注册页面*_*</td>
  </tr>
<tr>
    <td width="30%"  height="20"align="right">会员:</td>
    <td width="70%"><input name="username" type="text" id="username" maxlength="18">
    <span class="style6">*</span>(用户名长度为3-8位)</td>
  </tr>
  <tr>
    <td align="right">密码:</td>
    <td><input name="userpassword" type="password" id="userpassword" maxlength="18">
    <span class="style6">*</span>(密码长度为6-8位)</td>
  </tr>
  <tr>
    <td align="right">确认密码:</td>
    <td><input name="userpassword1" type="password" id="userpassword1" maxlength="18">
    </td>
  </tr>
  <tr>
    <td align="right">你的姓名:</td>
    <td><input name="name" type="text" id="name" maxlength="18"></td>
  </tr>
  <tr>
    <td align="right">身份证号:</td>
    <td><input name="idnumber" type="text" id="idnumber" maxlength="18"></td>
  </tr>
  <tr>
    <td align="right">性 别:</td>
    <td><input name="sex" type="text" id="sex" maxlength="18"></td>
  </tr>
  <tr>
    <td align="right">你的年龄:</td>
    <td><input name="age" type="text" id="age" maxlength="18"></td>
  </tr>
  <tr>
    <td align="right">详细地址:</td>
    <td><input name="address" type="text" id="address" maxlength="18" /></td>
  </tr>
  <tr>
    <td align="right">邮政编码:</td>
    <td><input name="zipcode" type="text" id="zipcode" maxlength="18"></td>
  </tr>
  <tr>
    <td align="right">电话号码:</td>
    <td><input name="phone" type="text" id="phone" maxlength="18" /></td>
  </tr>
  <tr>
    <td align="right">电子邮箱:</td>
    <td><input name="email" type="text" id="email" maxlength="18"></td>
  </tr>
  <tr>
    <td height="15" align="right"><input type="submit" name="submit" value="注册" ></td>
    <td align="left">  <input type="reset" name="submit" value="重置" /></td>
  </tr>
</form>
</table>
</body>
</html>
发表于 2009-10-29 14:05:03 | 显示全部楼层 IP:泰国
哈哈,好怕怕~~我每次看帖必回的~~藏了
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|小黑屋|最新主题|手机版|微赢网络技术论坛 ( 苏ICP备08020429号 )

GMT+8, 2024-9-30 03:24 , Processed in 0.222731 second(s), 15 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表