日期:2014-05-17 浏览次数:20606 次
<script type="text/javascript">
$(document).ready(function(){
$.formValidator.initConfig({formID:"formuser",theme:'ArrowSolidBox',mode:'AutoTip',onError:function(msg){alert(msg)},inIframe:true});
$("#uname").formValidator({onShow:"",onFocus:"用户名至少6个字符,最多18个字符",onCorrect:"该用户名可以注册"}).inputValidator({min:6,max:18,onError:"你输入的用户名非法,请确认"})
.ajaxValidator({
type : "get",
dataType : "html",
async : true,
url : "douname.asp?uname="+$("#uname").val(),
success : function(data){
if( data == "1" )
{
alert(data);
return true;
}
else
{
alert(data);
return false;
}
return false;
},
buttons: $("#button"),
error: function(jqXHR, textStatus, errorThrown){alert("服务器没有返回数据,可能服务器忙,请重试"+errorThrown);},
onError : "此用户名已被注册,请更换用户名",
onWait : "正在对用户名进行合法性校验,请稍候..."
});
});</script>
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%Response.CodePage=65001%>
<%Response.Charset="utf-8"%>
<!--#include file="../../Connections/conn.asp" -->
<%
Set cheuname = Server.CreateObject("ADODB.Recordset")
sql="select * from yh where uname = '"& trim(request.QueryString("uname")) &"'"
cheuname.open sql,MM_conn_STRING,1,1
If cheuname.EOF And cheuname.BOF Then
response.Write("1")
else
response.Write("0")
end if
cheuname.Close()
set cheuname = Nothing
%>