我想做一个简单的html语言做的网页,高手给代码

就是一个注册页面,用户名不能空,限制长度
密码和重复密码一样,限制长度5——20
邮箱必须合法
没了,希望高手指导,刚学的html,不怎么会
怎么样能迅速提高呢?

<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>
温馨提示:答案为网友推荐,仅供参考
第1个回答  2008-05-14
随便上个有会员注册的功能的网站到注册页面后另存该网页,学习其源代码。
第2个回答  2008-05-14
在百度搜“js邮箱验证代码”就会有好多,
这个代码没有什么难度,且别人都用过好多,所以没有自己写的必要,自己只写有创意的别人没有写过的代码
第3个回答  2008-05-14
那是动态吧
相似回答