一个通用的注册网页面

来源:互联网 发布:数据库一体机市场份额 编辑:程序博客网 时间:2024/06/05 20:02


<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>注册</title>
<style type="text/css">
<!--
.STYLE3 {
 font-family: "华文新魏";
 font-size: 28px;
 color: #FF0000;
 font-weight: bold;
}
.STYLE6 {
 font-family: "华文新魏";
 font-size: 24px;
 color: #FF0000;
 font-weight: bold;
}
.STYLE4 {
 color: #FF0000;
 font-style: italic;
}
td
{
font-family:"宋体";
 font-size: 16px;
 color: #000000;
 font-weight: bold;
}
.bo
{
 color:#000099;
 font-family:"宋体";
 font-size:16px;
}
.put
{
font-family:"宋体";
font-size:16px;
}
#Layer1 {
 position:absolute;
 left:167px;
 top:8px;
 width:470px;
 height:218px;
 z-index:2;
 background-color: #9900CC;
 visibility: visible;
}
.STYLE7 {
 font-family: "华文新魏";
 font-size: 36px;
 color: #FF0000;
 font-weight: bold;
 background-color:#003366;
}
#Layer2 {
 position:absolute;
 left:102px;
 top:40px;
 width:633px;
 height:140px;
 z-index:1;
 background-color: #006633;
}
.STYLE8 {font-size: 18px}
-->
</style>
<script language="javascript">
var str1="请你仔细填写以下注册信息!!!";//标题滚动消息
var strStatus="TOM免费邮件愿意为你提供优质服务";//状态滚动消息
var len1 = strStatus.length;//状态滚动消息的长度
var len=str1.length;//标题滚动消息的长度
var i = 0;//标题滚动消息长度变量
var j = 0;//状态滚动消息长度变量
var  statuconce =true;//状态滚动条件
var testOnce = true;//标题滚动条件
//滚动实现
function begin()

     window.status=strStatus.substr(strStatus,j);
  if(statuconce)
  {
    j++;
    if(j >len1)
    {
      statuconce = false;
    }
  }
  else
  {
    j --;
    if(j < 0)
    {
    statuconce = true;
    }
  }
 document.reg.disp.value = str1.substr(str1,i);
 if (testOnce)
 {
  i++;
  if(i > len)
  {
    testOnce = false;
  }
 }
 else
 {
    i--
    if(i < 0)
    {
      testOnce= true; 
    }
 }
 setTimeout("begin()",200);
}
//初始化验证码
var stryzm="";
var strC="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwyz1234567890";//验证码能够输出的字符集合
function  csh()
{
   var i;
   while(stryzm.length<5)
   {
       //抽取随机字符
    stryzm = stryzm+strC.charAt(Math.round(Math.random()*strC.length));
   }
 document.reg.text2.value = stryzm;
}

</script>
<script language="javascript">
<!--

var  uName;//用户名
var  uPass;//密码
var  confUP;//确认密码
var  seleP;//
var  ansP;
var  yzmP;
var strC="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwyz1234567890";
function userN()
{
 if((document.reg.userName.value.length >=4)&&(isLetter()))
 {
  document.reg.userName.style.color="green";
  uName = true;
 }
    else
 {
   document.reg.userName.style.color="red";
   uName = false;
 }
}
//判断是不是字符和用户名首字符是不字母开头
function  isLetter()
{
   var i;
   if(((document.reg.userName.value.charAt(0) >= 'a' )&&(document.reg.userName.value.charAt(0)<='z')) ||((document.reg.userName.value.charAt(0) >= 'A' )&&(document.reg.userName.value.charAt(0)<='Z')))
   {
      for(i = 1; i < document.reg.userName.value.length;i++)
   {
     if(strC.indexOf(document.reg.userName.value.charAt(i)) == -1)
    return false;
    }
      return  true;
    }
 else
 {
   return false;
 }
}
function userP()
{
 if((document.reg.userPass.value.length >=5) &&(document.reg.userPass.value.length <=12))
 {
     document.reg.userPass.style.color = "green";
  uPass = true;
 }
 else
 {
     document.reg.userPass.style.color = "red";
  uPass = false;
 }
 if(document.reg.confUserPass.value.length != 0)
 {
  if(document.reg.confUserPass.value == document.reg.userPass.value)
 {
  document.reg.confUserPass.style.color = "green";
  confUP = true;
 }
 else
 {
  document.reg.confUserPass.style.color = "red";
  confUP = false;
 }
 }
}
function confUserP()
{
 if(document.reg.confUserPass.value == document.reg.userPass.value)
 {
  document.reg.confUserPass.style.color = "green";
  confUP = true;
 }
 else
 {
  document.reg.confUserPass.style.color = "red";
  confUP = false;
 }
}

function sele()
{
   if(document.reg.passQuestion.value == "123")
   {
      ansP =false;
   document.body.all.list1.style.display="none";
   document.reg.passAnswer.value="";
   }
    else
   {
      ansP = true;
   document.reg.passAnswer.value="请输入密码答案";
   document.body.all.list1.style.display = "block";

   }
}
function opAnse()
{
 document.reg.passAnswer.value="";
}
function lpAnse()
{
    switch (document.reg.passQuestion.value)
 {
    case "like":
   if(document.reg.passAnswer.value != "jsp")
      {
        seleP =  false;
        document.reg.passAnswer.style.color ="red";
       }
      else
      {
      seleP =  true;
      document.reg.passAnswer.style.color ="green";
       }
    break;
  case "love":
    if(document.reg.passAnswer.value != "wqx")
    {
      seleP =  false;
      document.reg.passAnswer.style.color ="red";
       }
    else
        {
      seleP =  true;
        document.reg.passAnswer.style.color ="green";
            }
     break;

  case "master":
    if(document.reg.passAnswer.value != "zzh")
    {
      seleP =  false;
      document.reg.passAnswer.style.color ="red";
       }
    else
        {
      seleP =  true;
        document.reg.passAnswer.style.color ="green";
            }
     break;
  case "mycolor":
    if(document.reg.passAnswer.value != "green")
    {
      seleP =  false;
      document.reg.passAnswer.style.color ="red";
       }
    else
        {
      seleP =  true;
        document.reg.passAnswer.style.color ="green";
            }
     break;
 }
}
function yzm()
{
 if(document.reg.yzmI.value == document.reg.text2.value)
 {
   yzmP = true;
   document.reg.yzmI.style.color="green";
 }
 else
 {
   yzmP = false;
   document.reg.yzmI.style.color="red";
 }
}

function tijiao()
{
 if(document.reg.conf[1].checked==true)
 {
    if(confirm("是否要退出!"))
    {
       close();

      return false;
    }
    else
    {
   return false;
    }
 }
 
 if((uName)&&(uPass)&&(confUP)&&(seleP)&&(ansP)&&(yzmP))
 {
  alert("恭喜你可以注册了!!!");
  return true;
 }
 else if((document.reg.userName.value.length==0)||(document.reg.userPass.value.length==0)||(document.reg.confUserPass.value.length == 0)||(document.reg.passQuestion.value.length==0)||(document.reg.passAnswer.value.length == 0)||(document.reg.yzmI.value.length==0)||(ansP==false))
 {
   alert("有必填写项目没有填写");
   return false;
 }
 
 {
    alert("有错误,请检查红字显示的内容.")
    return false;
 }
 
}

function onres()
{
location.reload();
}

function avaible()
{
 if(uName)
 {
 alert("此名字可以用");
 }
 else
 alert("没法用,此名字不符合规定或已经注册");
}
function onmo()
{
  document.body.all.Layer2.style.visibility="visible";
}
function outmo()
{
document.body.all.Layer2.style.visibility="hidden";
}
//-->
</script>
</head>
<body onLoad="begin();csh()" bgcolor="#003366"  onContextMenu="return false">
<table width="564" height="416" border="0" align="center" cellpadding="0" cellspacing="0" style="position:absolute; top:0; left:120">
  <form name="reg" onSubmit="return tijiao()" >
  <tr>
    <td height="64" colspan="6" align="left"  bgcolor="#009933"><input name="disp" type="text" class="STYLE3"  style=" background-color:#009933; border:none" size="42" readonly="true"></td>
  </tr>
  <tr>
    <td height="40" colspan="6" bgcolor="#009966"> *号是必填项,请你认真填写</td>
  </tr>
  <tr bgcolor="#9900CC">
    <td height="14" colspan="6" bgcolor="#003300"><hr width="100%" size = 2 color="#000099" noshade="noshade" /></td>
  </tr>
  <tr bgcolor="#9900CC">
    <td width="19%" height="30" align="right" bgcolor="#999966">*用&nbsp;户&nbsp;名:</td>
    <td height="30" colspan="5" bgcolor="#999966"><input name="userName" type="text" class="put" onBlur="userN()" size="15" />
      <input name="isRegsiter" type="button" class="bo" value="是否可用" onClick="avaible()" />     
      请用英文和数字,英文开头.</td>
    </tr>
  <tr bgcolor="#9900CC">
    <td height="30" align="right" bgcolor="#999966">*密&nbsp;&nbsp;&nbsp;&nbsp;码:</td>
    <td height="30" colspan="5" bgcolor="#999966"><input name="userPass" type="password" class="put"  onBlur="userP()" size="15" />
      &nbsp;请使用5-12位. </td>
    </tr>
  <tr bgcolor="#9900CC">
    <td height="30" align="right" bgcolor="#999966">*确&nbsp;&nbsp;&nbsp;&nbsp;认:</td>
    <td height="30" colspan="5" bgcolor="#999966"><input name="confUserPass" type="password" class="put" onBlur="confUserP()" size="15" />
      &nbsp;请再输入一次你的密码.</td>
    </tr>
  <tr bgcolor="#9900CC">
    <td height="30" align="right" bgcolor="#999966">*密码问题:</td>
    <td height="30" colspan="5" bgcolor="#999966"><select name="passQuestion" class="put"  onChange="sele()">
      <option selected  value="123" >请选择密码问题</option>
      <option value="like">你最喜欢的人</option>
      <option value="love">你曾经最爱的人</option>
      <option value="master">你小学的班主任</option>
      <option value="mycolor">你最喜欢的颜色</option>
    </select></td>
  </tr>
  <tr bgcolor="#9900CC" style="display:none" id = "list1" >
    <td height="30" align="right" bgcolor="#999966">*密码答案:</td>
    <td height="30" colspan="5" bgcolor="#999966"><input name="passAnswer" type="text" class="put" onFocus="opAnse()" onBlur="lpAnse()" value="请输入密码答案" size="15" /></td>
  </tr>
  <tr bgcolor="#9900CC">
    <td height="30" align="right" bgcolor="#999966">*验&nbsp;证&nbsp;码:</td>
    <td height="30" colspan="2" bgcolor="#999966"><input name="yzmI" type="text" class="put"  onBlur="yzm()" size="15"/></td>
    <td width="23%" height="30" bgcolor="#999966">请你输入验正码&nbsp;</td>
    <td width="27%" height="30" colspan="2" rowspan="2" align="left" valign="top" bgcolor="#999966"><input name="text2" type="text" class="STYLE6"   style=" background-color:#999966; border:none" size="8" readonly=""/></td>
  </tr>
  <tr bgcolor="#9900CC">
    <td height="30" align="right" bgcolor="#999966">*性&nbsp;&nbsp;&nbsp;&nbsp;别:</td>
    <td height="30" colspan="2" bgcolor="#999966"><input type="radio"  name="sexy"  checked="checked"/>
      男&nbsp;</td>
    <td height="30" bgcolor="#999966"><input type="radio" name="sexY"  />
      女</td>
    </tr>
  <tr>
    <td height="40" colspan="2" bgcolor="#999966" >请认真阅读<span class="STYLE4" id= "rule" style=" text-decoration:underline" onMouseOver="onmo()" onMouseOut="outmo()" >TOM条款</span></td>
    <td width="20%" bgcolor="#999966"><input type="radio" name="conf"   checked="checked"  />同意 </td>
    <td colspan="3" bgcolor="#999966"><input type="radio" name="conf"/>不同意 </td>
    </tr>
  <tr>
    <td height="48" bgcolor="#999966">&nbsp;</td>
    <td width="11%" bgcolor="#999966">&nbsp;</td>
    <td bgcolor="#999966"><input type="submit" class="bo"  value="提交"  /></td>
    <td colspan="3" bgcolor="#999966"><input type="button" class="bo" onClick="onres()" value="重来"/></td>
    </tr>
  </form>
</table>
<div id="Layer2" style="border-color:#33FF00; border-style:dotted; visibility:hidden" >
  <div align="center" class="STYLE7" style=" border-bottom-style:ridge">TOM网络声明</div>
  <span class="STYLE8">1</span><span class="STYLE8">、注册TOM公司的免费邮箱就表示你已经默认同意了TOM公司免费邮箱的细节。<br>
  2、不能散发和传播有种族歧视的、有和平的文章和言论。<br>
  3、TOM公司对免费邮箱的邮件被盗不付有法律责任。<br>
  4、六个月内必须登陆一次,否则TOM公司将有权利给予注销。<br>
  5、TOM公司对免费邮箱不会进行邮件过滤服务。 </span>
</div>
</body>
</html>
 

原创粉丝点击