标题:我有一段注册码总通不过,不知为什么,请大虾帮助
只看楼主
xhdxhd123
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2012-1-11
结帖率:50%
已结贴  问题点数:20 回复次数:4 
我有一段注册码总通不过,不知为什么,请大虾帮助
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<style type="text/css">
<!--表格定义样式,仅显示横边框 -->
body{
font-size:12px;
line-height:20px;
background:url();
}
table.tab{}
table.tab td{
height:30px;border-bottom:1px dashed #546F07;border-left:0px;border-right:0px;
}
<!--表格定义样式,全虚线边框 -->
.v tr{height:30px;}
.v {border-collapse: collapse}
.v td{border:1px dashed #6FB7E7;width:100;height:25; padding:0 5px;}

</style>

<script language="javascript">
function loginCheck()
{
if(document.myform.xm.value=="")
{
document.getElementById("divxm").innerHTML="登陆名不能为空";
document.myform.xm.focus();
return false
}
if(document.myform.xm.value.length<5)
{
document.getElementById("divxm").innerHTML="登陆名不少于5位";
document.myform.xm.focus();
return false
}
else
{
document.getElementById("divxm").innerHTML="<font color=#009900>√</font>";
}



if(document.myform.passswd.value=="")
{
document.getElementById("divpasswd").innerHTML="密码不能为空";
document.myform.passwd.focus();
return false;
}
if(document.myform.passwd.value.length<6)
{
document.getElementById("divpasswd").innerHTML="密码不少于6位";
document.myform.passwd.focus();
return false;
}
else
{
document.getElementById("divpasswd").innerHTML="<font color=#009900>√</font>";
}






if(document.myform.ver.value=="")
{
document.getElementById("divver").innerHTML="密码验证不能为空";
document.myform.ver.focus();
return false;
}
else
{
document.getElementById("divver").innerHTML="<font color=#009900>√</font>";
}


if(document.myform.ver.value<>document.myform.passwd.value)
{
document.getElementById("divver").innerHTML="密码验证码与密码不同";
document.myform.ver.focus();
return false;
}
else
{
document.getElementById("divver").innerHTML="<font color=#009900>√</font>";
}


if(document.myform.nam.value=="")
{
document.getElementById("divnam").innerHTML="昵称不能为空";
document.myform.nam.focus();
return false;
}
else
{
document.getElementById("divnam").innerHTML="<font color=#009900>√</font>";
}


if(document.myform.idnumber.value.length==18)
{
document.getElementById("dividnumber").innerHTML="身份证号码不对";
document.myform.idnumber.focus();
return false;
}
else
{
document.getElementById("dividnumber").innerHTML="<font color=#009900>√</font>";
}















if(document.myform.email.value=="")
{
document.getElementById("divemail").innerHTML="邮箱不能为空";
document.myform.email.focus();
return false;
}
else
{
document.getElementById("divemail").innerHTML="<font color=#009900>√</font>";
}



}
/*实现在页面加载时使用户名框获得焦点*/
window.onload = f;
function f(){document.getElementById("xm").focus();}
</script>

</head>

<body>

<table width="778" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#0033CC" class="bt_link18">
  <tr>
    <td height="25" bgcolor="#FFFFFF"><img src="images/top.gif" width="775" height="150"></td>
  </tr>
  <tr>
    <td height="28" bgcolor="#FFFFFF"><img src="images/register.gif" width="184" height="59">                   <a href="xfindex.asp">          返回系统首页</a>或<a href="http://www.yzxf.返回网站首页</a></td>
  </tr>
  <tr>
    <td height="346" bgcolor="#FFFFFF">
    <div style="width:777px; overflow:hidden; text-align:left;">
    <form action="adduser.asp" method="post" name="myform" id="myform">
      <table width="100%" height="316"  border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#0000FF">
        <tr bgcolor="#FFFFFF">
          <td width="15%" height="23"><div align="right">用户名:</div></td>
          <td width="49%"><h3>
                  <input name="xm" type="text" id="xm" size="20" maxlength="20">
                  </td>
          <td width="36%"><div id="divxm"></div></td>
        </tr>
        <tr bgcolor="#FFFFFF">
          <td height="25"><div align="right">密码:</div></td>
          <td><input name="passwd" type="text" id="passwd" size="20" maxlength="20">
            *</td>
          <td><div id="divpasswd" style="color:#f00;"></div></td>
        </tr>
        <tr bgcolor="#FFFFFF">
          <td height="23"><div align="right">确认密码:</div></td>
          <td><input name="ver" type="text" id="ver" size="20" maxlength="20">
            *</td>
          <td><div id="divver" style="color:#f00;"></div></td>
        </tr>
        <tr bgcolor="#FFFFFF">
          <td height="28"><div align="right">你的真实姓名:</div></td>
          <td><input name="nam" type="text" id="nam" size="15" maxlength="15">
            *</td>
          <td><div id="divnam" style="color:#f00;"></div></td>
        </tr>
        <tr bgcolor="#FFFFFF">
          <td height="24"><div align="right">身份证号码:</div></td>
          <td><input name="idnumber" type="text" id="idnumber" size="18" maxlength="18">
            *</td>
          <td><div id="dividnumber" style="color:#f00;"></div></td>
        </tr>
        <tr bgcolor="#FFFFFF">
          <td height="28"><div align="right">性别:</div></td>
          <td><select name="sex" id="sex">
            <option value="男">男</option>
            <option value="女">女</option>
          </select>
            *</td>
          <td><div id="divsex" style="color:#f00;"></div></td>
        </tr>
        <tr bgcolor="#FFFFFF">
          <td height="26"><div align="right">年龄:</div></td>
          <td><input name="age" type="text" id="age" size="5" maxlength="5">
            *</td>
          <td><div id="divage" style="color:#f00;"></div></td>
        </tr>
        <tr bgcolor="#FFFFFF">
          <td height="27"><div align="right">详细地址:</div></td>
          <td><input name="address" type="text" id="address" size="40" maxlength="40">
            *</td>
          <td><div id="divaddress" style="color:#f00;"></div></td>
        </tr>
        <tr bgcolor="#FFFFFF">
          <td height="25"><div align="right">邮政编码:</div></td>
          <td><input name="zipcode" type="text" id="zipcode" size="6" maxlength="6">
            *</td>
          <td><div id="divzipcode" style="color:#f00;"></div></td>
        </tr>
        <tr bgcolor="#FFFFFF">
          <td height="24"><div align="right">电话号码:</div></td>
          <td><input name="phone" type="text" id="phone" size="20" maxlength="20">
            *</td>
          <td><div id="divphone" style="color:#f00;"></div></td>
        </tr>
        <tr bgcolor="#FFFFFF">
          <td height="26"><div align="right">你的EMAIL:</div></td>
          <td><input name="email" type="text" id="email" size="20" maxlength="20">
            *</td>
          <td><div id="divemail" style="color:#f00;"></div></td>
        </tr>
        <tr bgcolor="#FFFFFF">
          <td>&nbsp;</td>
          <td align="center"><input type="submit" name="xhd" value="提交" onClick="return loginCheck()">
            <input type="reset" name="xhd2" value="重置"></td>
          <td>&nbsp;</td>
        </tr>
      </table>
    </form></div></td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF">&nbsp;</td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF">&nbsp;</td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF">&nbsp;</td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF">&nbsp;</td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF">&nbsp;</td>
  </tr>
</table>
</body>
</html>
搜索更多相关主题的帖子: background content PUBLIC 注册码 style 
2012-01-11 14:48
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
得分:14 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<style type="text/css">
<!--表格定义样式,仅显示横边框 -->
body{
font-size:12px;
line-height:20px;
background:url();
}
table.tab{}
table.tab td{
height:30px;border-bottom:1px dashed #546F07;border-left:0px;border-right:0px;
}
<!--表格定义样式,全虚线边框 -->
.v tr{height:30px;}
.v {border-collapse: collapse}
.v td{border:1px dashed #6FB7E7;width:100;height:25; padding:0 5px;}

</style>

<script language="javascript">
function loginCheck()
{
  if(document.myform.xm.value=="")
  {
     document.getElementById("divxm").innerHTML="登陆名不能为空";
     document.myform.xm.focus();
     return false
  }
  if(document.myform.xm.value.length<5)
  {
    document.getElementById("divxm").innerHTML="登陆名不少于5位";
    document.myform.xm.focus();
    return false
  }
  else
  {
    document.getElementById("divxm").innerHTML="<font color=#009900>√</font>";
  }
  if(document.myform.passswd.value=="")
  {
    document.getElementById("divpasswd").innerHTML="密码不能为空";
    document.myform.passwd.focus();
    return false;
  }
  if(document.myform.passwd.value.length<6)
  {
    document.getElementById("divpasswd").innerHTML="密码不少于6位";
    document.myform.passwd.focus();
    return false;
  }
  else
  {
    document.getElementById("divpasswd").innerHTML="<font color=#009900>√</font>";
  }
  if(document.myform.ver.value=="")
  {
    document.getElementById("divver").innerHTML="密码验证不能为空";
    document.myform.ver.focus();
    return false;
  }
  else
  {
    document.getElementById("divver").innerHTML="<font color=#009900>√</font>";
  }
  if(document.myform.ver.value<>document.myform.passwd.value)//javascript里这个"!="表示不等于
  {
    document.getElementById("divver").innerHTML="密码验证码与密码不同";
    document.myform.ver.focus();
    return false;
  }
  else
  {
    document.getElementById("divver").innerHTML="<font color=#009900>√</font>";
  }
  if(document.myform.nam.value=="")
  {
    document.getElementById("divnam").innerHTML="昵称不能为空";
    document.myform.nam.focus();
    return false;
  }
  else
  {
    document.getElementById("divnam").innerHTML="<font color=#009900>√</font>";
  }
  if(document.myform.idnumber.value.length==18)
  {
    document.getElementById("dividnumber").innerHTML="身份证号码不对";
    document.myform.idnumber.focus();
    return false;
  }
  else
  {
    document.getElementById("dividnumber").innerHTML="<font color=#009900>√</font>";
  }
  if(document.myform.email.value=="")
  {
   document.getElementById("divemail").innerHTML="邮箱不能为空";
   document.myform.email.focus();
   return false;
  }
  else
  {
    document.getElementById("divemail").innerHTML="<font color=#009900>√</font>";
  }
}
/*实现在页面加载时使用户名框获得焦点*/
window.onload = f;
function f()
{
   document.getElementById("xm").focus();
}
</script>

</head>

<body>

<table width="778" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#0033CC" class="bt_link18">
  <tr>
    <td height="25" bgcolor="#FFFFFF"><img src="images/top.gif" width="775" height="150"></td>
  </tr>
  <tr>
    <td height="28" bgcolor="#FFFFFF"><img src="images/register.gif" width="184" height="59">                   <a href="xfindex.asp">          返回系统首页</a>或<a href="http://www.yzxf.返回网站首页</a></td>
  </tr>
  <tr>
    <td height="346" bgcolor="#FFFFFF">
    <div style="width:777px; overflow:hidden; text-align:left;">
    <form action="adduser.asp" method="post" name="myform" id="myform">
      <table width="100%" height="316"  border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#0000FF">
        <tr bgcolor="#FFFFFF">
          <td width="15%" height="23"><div align="right">用户名:</div></td>
          <td width="49%"><h3>
                  <input name="xm" type="text" id="xm" size="20" maxlength="20">
                  </td>
          <td width="36%"><div id="divxm"></div></td>
        </tr>
        <tr bgcolor="#FFFFFF">
          <td height="25"><div align="right">密码:</div></td>
          <td><input name="passwd" type="text" id="passwd" size="20" maxlength="20">
            *</td>
          <td><div id="divpasswd" style="color:#f00;"></div></td>
        </tr>
        <tr bgcolor="#FFFFFF">
          <td height="23"><div align="right">确认密码:</div></td>
          <td><input name="ver" type="text" id="ver" size="20" maxlength="20">
            *</td>
          <td><div id="divver" style="color:#f00;"></div></td>
        </tr>
        <tr bgcolor="#FFFFFF">
          <td height="28"><div align="right">你的真实姓名:</div></td>
          <td><input name="nam" type="text" id="nam" size="15" maxlength="15">
            *</td>
          <td><div id="divnam" style="color:#f00;"></div></td>
        </tr>
        <tr bgcolor="#FFFFFF">
          <td height="24"><div align="right">身份证号码:</div></td>
          <td><input name="idnumber" type="text" id="idnumber" size="18" maxlength="18">
            *</td>
          <td><div id="dividnumber" style="color:#f00;"></div></td>
        </tr>
        <tr bgcolor="#FFFFFF">
          <td height="28"><div align="right">性别:</div></td>
          <td><select name="sex" id="sex">
            <option value="男">男</option>
            <option value="女">女</option>
          </select>
            *</td>
          <td><div id="divsex" style="color:#f00;"></div></td>
        </tr>
        <tr bgcolor="#FFFFFF">
          <td height="26"><div align="right">年龄:</div></td>
          <td><input name="age" type="text" id="age" size="5" maxlength="5">
            *</td>
          <td><div id="divage" style="color:#f00;"></div></td>
        </tr>
        <tr bgcolor="#FFFFFF">
          <td height="27"><div align="right">详细地址:</div></td>
          <td><input name="address" type="text" id="address" size="40" maxlength="40">
            *</td>
          <td><div id="divaddress" style="color:#f00;"></div></td>
        </tr>
        <tr bgcolor="#FFFFFF">
          <td height="25"><div align="right">邮政编码:</div></td>
          <td><input name="zipcode" type="text" id="zipcode" size="6" maxlength="6">
            *</td>
          <td><div id="divzipcode" style="color:#f00;"></div></td>
        </tr>
        <tr bgcolor="#FFFFFF">
          <td height="24"><div align="right">电话号码:</div></td>
          <td><input name="phone" type="text" id="phone" size="20" maxlength="20">
            *</td>
          <td><div id="divphone" style="color:#f00;"></div></td>
        </tr>
        <tr bgcolor="#FFFFFF">
          <td height="26"><div align="right">你的EMAIL:</div></td>
          <td><input name="email" type="text" id="email" size="20" maxlength="20">
            *</td>
          <td><div id="divemail" style="color:#f00;"></div></td>
        </tr>
        <tr bgcolor="#FFFFFF">
          <td>&nbsp;</td>
          <td align="center"><input type="submit" name="xhd" value="提交" onClick="return loginCheck()">
            <input type="reset" name="xhd2" value="重置"></td>
          <td>&nbsp;</td>
        </tr>
      </table>
    </form></div></td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF">&nbsp;</td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF">&nbsp;</td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF">&nbsp;</td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF">&nbsp;</td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF">&nbsp;</td>
  </tr>
</table>
</body>
</html>
2012-01-12 12:58
xhdxhd123
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2012-1-11
得分:0 
回复 2楼 yms123
代码还是不对,请标注一下你改了哪里

[ 本帖最后由 xhdxhd123 于 2012-1-13 10:37 编辑 ]
2012-01-13 10:31
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
得分:0 
以下是引用xhdxhd123在2012-1-13 10:31:44的发言:

代码还是不对,请标注一下你改了哪里

 if(document.myform.ver.value<>document.myform.passwd.value)//javascript里这个"!="表示不等于
所以这句话要改成
 if(document.myform.ver.value!=document.myform.passwd.value)//javascript里这个"!="表示不等于
2012-01-14 00:50
xhdxhd123
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2012-1-11
得分:0 
回复 4楼 yms123
十分感谢,用户名验证通过了,但其它的项验证还是不起作用
2012-01-16 09:07



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-359521-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.025006 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved