<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
<html xmlns="http://www.111cn.net/ 1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312" />
<script language="javascript教程">
password
var tmp=document.regform.u_password.value;
if (tmp.length < 6){
alert ("提示: 密码长度必须大于6");
document.regform.u_password.focus();
return false;
}
if ( tmp.length <6 ){ // && /^d+$/.test(tmp)
alert ("提示:密码过于简单,请设置字母、数字或符号的组合。");
document.regform.u_password.focus();
return false;
}
if (document.regform.u_password2.value != document.regform.u_password.value){
alert ("提示: 两次密码不一致");
document.regform.u_password2.focus();
return false;
}
</script>
</head>
<body>
<form id="form1" name="regform" method="post" action="">
<label>
输入密码:
<input type="password" name="u_password" />
确认密码:
<input type="password" name="u_password2" />
</label>
<label>
<input type="submit" name="submit" value="验证" onclick="checkpass();"/>
</label>
</form>
</body>
</html>