日期:2014-05-16 浏览次数:20342 次
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312" /> <title>无标题文档</title> <script src="js/jquery-1.5.1.min.js" type="text/javascript"></script> <script src="js/My97DatePicker/WdatePicker.js" type="text/javascript" language="javascript"></script> <script src="js/LocationSelect/location.js" type="text/javascript"></script> <script type="text/javascript"> $(function(){ $("#loc").LocationSelect(); }); </script> </head> <style type="text/css"> body{ margin:0 auto;} #top{ width:960px; height:25px; margin:0 auto; } #top p{ margin-top:8px;} #zhuce{ width:800px; height:78px; margin:20px auto;} #loginTa{ width:800px; height:auto; border:1px solid #DCDCDC; background-color:#FDFDFD; margin:10px auto; } #loginTa a{ text-decoration:none;} .but1{ width:56px; height:25px; background-color:#F4961A; color:#FFFFFF; border:0px;} .but1:hover{ background-color:#E66D02; border:0;} .td66{ color:#666666; font-size:12px;} input{ border:1px solid #CACACA;} input:hover{ border:1px solid #64B0D7;} .tdtitle{ color:#000000; font-size:14px;} .onError{ background:url(images/reg3.gif) no-repeat 0 center; padding-left:25px;} .onSuccess{ background:url(images/reg4.gif) no-repeat 0 center; padding-left:25px;} span{ width:auto; height:30px;;} span font{ width:auto; height:25px; margin-bottom:5px; border:1px solid red; font-size:12px; padding:5px 5px 0px 5px; background-color:#FFF8ED;} </style> <script type="text/javascript"> $(function(){ $("form :input").blur(function(){ var $parent=$(this).parent(); $parent.find(".onError").remove(); $parent.find(".onSuccess").remove(); if($(this).is('#user_name')){ var reg1=/^\b[a-zA-Z]$/; var reg2=/^[a-zA-z][a-zA-Z0-9_]+$/; var str=this.value; if(this.value==""){ var errorMsg='请输入用户名!'; $parent.append('<span class="onError"><font>'+errorMsg+'</font></span>'); }else { if(this.value.length < 6 || this.value.length >10 || reg2.test(str)==false){ var errorMsg='用户名格式不正确!'; $parent.append('<span class="onError"><font>'+errorMsg+'</font></span>'); }else { $.get("RegisterAjax.php", {user_name:this.value}, function(data,textstatus){ //alert(data); if(data==1){ var errorMsg='该用户名已存在!'; $parent.append('<span class="onError"><font>'+errorMsg+'</font></s