<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.111cn.net/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" />
<title>jquery邮箱 密码验证实例(jquery 验证插件)</title>
<script>
function doregister(){
var name = $('#regemail').val();
var search_str = /^[w-.]+@[w-.]+(.w+)+$/;
if(!search_str.test(name)){
alert("邮箱不合法!");
$("#regemail").val('');
$("#regemail").focus();
return false;
}
var password = $('#regpassword').val();
if(password.length<6){alert('密码至少6位!');return false;}
var confirm = $('#regconfirm').val();
if(confirm!=password){alert("密码校对有误!");return false;}
$.post('/ajaxregister.php教程',{email:name,pwd:password},function(data){
if(data=='n'){alert('注册失败!');return false;}
if(data=='yan'){alert('验证码出错!');imcref2();return false;}
if(data=='email'){alert('用户名已注册!');return false;}
if(data=='y'){
lejulogin(name,password);
}
});
}
</script>
</head><body>
</body>
</html>