<html>
<head>
<title>验证用户名和密码</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="Css/style.css" rel="stylesheet">
<script language="javascript">
function check(myform){
if(myform.username.value==""){
alert("请输入用户名!");myform.username.focus();return;
}
if(!checkeusername(myform.username.value)){
alert("您输入的用户名不合法!");myform.username.focus();return;
}
if(myform.PWD.value==""){
alert("请输入密码!");myform.PWD.focus();return;
}
if(!checkePWD(myform.PWD.value)){
alert("您输入的密码不合法!");myform.PWD.focus();return;
}
if(myform.PWD1.value==""){
alert("请确认密码!");myform.PWD1.focus();return;
}
if(myform.PWD1.value!=myform.PWD.value){
alert("您两次输入的密码不一致,请重新输入!");myform.PWD.focus();return;
}
myform.submit();
}
function checkeusername(username){
var str=username;
//在JavaScript中,正则表达式只能使用"/"开头和结束,不能使用双引号
var Expression=/^(\w){3,10}$/;
var objExp=new RegExp(Expression);
if(objExp.test(str)==true){
return true;
}else{
return false;
}
}
function checkePWD(PWD){
var str=PWD;
//在JavaScript中,正则表达式只能使用"/"开头和结束,不能使用双引号
var Expression=/^[A-Za-z]{1}([A-Za-z0-9]|[._]){5,19}$/;
var objExp=new RegExp(Expression);
if(objExp.test(str)==true){
return true;
}else{
return false;
}
}
</script>
</head>
<body>
<table width="694" height="341" border="0" align="center" cellpadding="-2" cellspacing="-2">
<tr>
<td valign="top">
<table width="100%" height="492" border="0" cellpadding="-2" cellspacing="-2" class="tableBorder">
<tr>
<td height="32" background="Images/board_left.gif"><img src="Images/01.gif" width="694" height="168"></td>
</tr>
<tr valign="top">
<td height="322"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="35" height="322" valign="top"><img src="Images/02.gif" width="35" height="89"></td>
<td valign="top">
<table width="100%" height="292" border="0" cellpadding="-2" cellspacing="-2" class="tableBorder_Top">
<tr>
<td height="5"></td>
</tr>
<tr>
<td width="170" height="281" valign="top" class="tableBorder_r"><table width="96%" border="0" cellspacing="-2" cellpadding="-2">
<tr>
<td width="55%" height="82" align="center" class="word_grey"> <img src="Images/reg.gif" width="84" height="54"></td>
<td width="45%" align="left" class="word_grey"><b>注册帮助</b></td>
</tr>
<tr>
<td height="112" colspan="2" valign="top" class="word_grey"><ul>
<li>
用户名:<span class="tablebody1">用户名由3-10位的字母、数字或下划线组成</span>。<br>
<br>
</li>
<li>密码:<span class="tablebody1">密码由6-20位的字母、数字、下划线、点“.”组成</span>并且首字符为字母。<br>
</li>
</ul>
</td>
</tr>
<tr align="center">
<td colspan="2" valign="middle" class="word_grey"></td>
</tr>
</table></td>
<td width="1"></td>
<td width="400" valign="top">
<table width="90%" border="0" align="center" cellpadding="-2" cellspacing="-2">
<tr>
<td><form action="" method="post" name="form1">
<table width="100%" border="0" cellspacing="-2" cellpadding="-2">
<tr>
<td height="10" colspan="2" align="center"></td>
</tr>
<tr>
<td width="18%" height="29" align="center">用 户 名:</td>
<td width="82%"><input name="username" type="text" id="UserName4" maxlength="20">
<span class="word_grey"> *</span></td>
</tr>
<tr>
<td height="28" align="center">密 码:</td>
<td height="28"><input name="PWD" type="password" id="PWD14" size="20" maxlength="20">
<span class="word_grey"> *</span></td>
</tr>
<tr>
<td height="28" align="center">确认密码:</td>
<td height="28"><input name="PWD1" type="password" id="PWD25" size="20" maxlength="20">
<span class="word_grey">*</span></td>
</tr>
<tr>
<td height="28" align="center">性 别:</td>
<td><input name="sex" type="radio" class="noborder" value="男" checked>
男
<input name="sex" type="radio" class="noborder" value="女">
女</td></tr>
<tr>
<td height="28" align="center">真实姓名:</td>
<td class="word_grey"><input name="realname" type="text" id="realname" maxlength="20"></td>
</tr>
<tr>
<td height="28" align="center">生 日:</td>
<td class="word_grey"><input name="birthday" type="text" id="Tel">
(日期格式为:yyyy-mm-dd )</td>
</tr>
<tr>
<td height="28" align="center">OICQ号码:</td>
<td><input name="qq" type="text" id="qq"></td>
</tr>
<tr>
<td height="28" align="center" style="padding-left:10px">Email:</td>
<td class="word_grey"><input name="Email" type="text" id="PWD224" size="50"> </td>
</tr>
<tr>
<td height="34"> </td>
<td class="word_grey"><input name="Button" type="button" class="btn_grey" value="确定保存" onClick="check(form1)">
<input name="Submit2" type="reset" class="btn_grey" value="重新填写"></td>
</tr>
</table>
</form></td>
</tr>
</table></td>
</tr>
<tr>
<td height="5"></td>
</tr>
</table>
</td>
<td width="44" valign="top"><img src="Images/04.gif" width="44" height="89"></td>
</tr>
</table></td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
没有合适的资源?快使用搜索试试~ 我知道了~
javascript范例宝典
共302个文件
gif:225个
css:25个
htm:25个
需积分: 0 21 下载量 194 浏览量
2008-09-15
22:56:10
上传
评论
收藏 2.02MB RAR 举报
温馨提示
javascript常用范例 实例简单易学 内容全面 因为内容庞大 这是03章
资源推荐
资源详情
资源评论
收起资源包目录
javascript范例宝典 (302个子文件)
function.asp 422B
function.asp 264B
bg.bmp 276KB
bg1.bmp 146KB
style.css 3KB
style.css 3KB
style.css 2KB
style.css 2KB
style.css 2KB
style.css 2KB
style.css 2KB
style.css 2KB
style.css 2KB
style.css 2KB
style.css 2KB
style.css 2KB
style.css 2KB
style.css 2KB
style.css 2KB
style.css 2KB
style.css 2KB
style.css 2KB
style.css 2KB
style.css 2KB
style.css 2KB
style.css 2KB
style.css 793B
style.css 793B
style.css 793B
Thumbs.db 24KB
Thumbs.db 24KB
Thumbs.db 10KB
Thumbs.db 9KB
Thumbs.db 8KB
01.gif 50KB
01.gif 50KB
01.gif 50KB
01.gif 50KB
01.gif 50KB
bg_top.gif 41KB
bg_top.gif 41KB
top_bg.gif 29KB
center_checkout.gif 20KB
center.gif 17KB
reply_navigate.gif 12KB
reply_navigate.gif 12KB
banner_bg.gif 11KB
banner_bg.gif 11KB
bg.gif 10KB
main.gif 10KB
main.gif 10KB
bg.gif 10KB
bg.gif 9KB
bg.gif 9KB
main.gif 9KB
bg.gif 9KB
bg.gif 9KB
bg.gif 9KB
result.gif 7KB
result.gif 7KB
result.gif 7KB
board_title.gif 5KB
main_readersort_1.gif 5KB
main_booksort.gif 5KB
board_title.gif 5KB
face14.gif 4KB
2.gif 4KB
2.gif 4KB
2.gif 4KB
2.gif 4KB
2.gif 4KB
4.gif 3KB
undefined.gif 3KB
4.gif 3KB
undefined.gif 3KB
4.gif 3KB
undefined.gif 3KB
4.gif 3KB
undefined.gif 3KB
4.gif 3KB
undefined.gif 3KB
16.gif 3KB
16.gif 3KB
16.gif 3KB
16.gif 3KB
16.gif 3KB
bg.gif 3KB
10.gif 3KB
10.gif 3KB
10.gif 3KB
10.gif 3KB
10.gif 3KB
14.gif 3KB
14.gif 3KB
14.gif 3KB
14.gif 3KB
14.gif 3KB
3.gif 3KB
3.gif 3KB
3.gif 3KB
共 302 条
- 1
- 2
- 3
- 4
资源评论
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功