一个简单的登陆程序《htnl》

作者在 2010-06-23 17:44:59 发布以下内容
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新用户注册</title>
<style>
body,td
{font-size:12px}
.bk
{color: #f78d00; border:1px #f78d00 solid;}
.Tips_bo
{
FONT-FAMILY
: "Arial", "宋体";
BORDER
: 0px #f78d00 solid;
FONT-SIZE
: 12px;
COLOR
: #f78d00;  
text-decoration
: none;
POSITION
: relative;
HEIGHT
: 19;
}
</style>
<script language="JavaScript">

//检测注册表单
function checkRegistForm(form)
{
//用户名是否为空
if(form.username.value == "")
{
  alert(
"请输入用户名");
  form.username.focus();
  
return(false);
}

//密码是否为空
if (form.password.value == "")
  {
    alert(
"请输入注册密码");
    form.password.focus();
    
return (false);
  }
  
  
//两次密码是否一致
  if(form.password.value != form.checkpassword.value)
  {
    alert(
"两次输入的密码不正确");
    form.password.focus();
    
return(false);
}

//电子邮箱是否正确
if(form.email.value != "" &&
form.email.value.search(
/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) == -1)
{
  alert(
"电子邮箱地址不正确");
  form.email.focus();
  
return(false);
}
  }
</script>


</head>
<body bgColor="#FFCC00" text="#000000" >
<center>
<form method="post" language="javascript" onsubmit="return checkRegistForm(form)" action="?action=save" name="form">
  <table width="399" border="0" bgcolor="#FFFFFF" height="27">
    <tr>
      <td height="33" width="393" align="center" colspan="2"> 用 户 注 册 <hr align="center" color="#ff0000" SIZE="1" width="98%"></td>
    </tr>
    <tr>
      <td height="28" width="62"> 用户名称:</td>
      <td height="28" width="327"> <INPUT maxLength=20 size=16 name=username class="bk">
        *登陆名称(英文字母/数字)</td>    
    </tr>
    <tr>
      <td height="28" width="62"> 用户密码:</td>
      <td height="28" width="327"> <INPUT maxLength=20 size=16 name=password class="bk" type="password">
        *登陆密码(英文字母/数字)</td>    
    </tr>
    <tr>
      <td height="28" width="62"> 验证密码:</td>
      <td height="28" width="327"> <INPUT maxLength=20 size=16 name=checkpassword class="bk" type="password">
        *再重复输入一次用户密码</td>    
    </tr>
    <tr>
      <td height="28" width="62"> 电子邮件:</td>
      <td height="28" width="327"> <INPUT maxLength=80 size=16 name=email class="bk">
        *经常使用的E-mail</td>  
    </tr>
    <tr>
      <td height="1" width="393" colspan="2">
        <p align="center">  <input type="submit" value=" 注 册 " name="B1" class="Tips_bo">    
        <input type="button" value=" 关 闭 " name="B3" class="Tips_bo" onclick="javascript:window.close();"></p>
      </td>
    </tr>
  </table>
</form>
</center>
</body>
</html>

默认分类 | 阅读 789 次
文章评论,共0条
游客请输入验证码