reg.asp<table cellpadding="0" cellspacing="3" width="100%" align="center" border="0" >
<tr>
<td class="td_1"><font class="Lucida_10pt">Account:</font></td>
<td class="td_2"><span><input name="account" type="text" class="Text_1" style="width:150px"  onblur="Javascript:CheckUserName(this);" /></span><span id="msgAccount"/></td>
</tr>
</TABLE>
<script language="javascript"> function CheckUserName(objName)  // Check Account
{
var sAccount = objName.value;
//alert(sAccount);
if ((sAccount == null) || (sAccount == "")) return;
var url = "register_check.asp?account=" + escape(sAccount);
xmlHttp.open("GET", url, true);
xmlHttp.onreadystatechange = updatePage;
xmlHttp.send(null);  
}

function updatePage() 
{
var msgAccount=document.getElementById("msgAccount");
if (xmlHttp.readyState < 4) 
{
msgAccount.innerHTML="<img src='img/check_user_loader.gif' border=0/>";
}
if (xmlHttp.readyState == 4) 
{
var response = xmlHttp.responseText;
if(response=='true')
{
msgAccount.innerHTML="<font color=red style='font-family:Lucida Console'>×&nbsp;</font>" + " Account name already registered!";
ErrorMsg=1;
}
else
{
msgAccount.innerHTML="<font color=red style='font-family:Lucida Console'>√</font>";
ErrorMsg=0;
}
}

}
</SCRIPT>register_check.asp conn.open str
sql="select * from NC_User where user_account='" & Request("saccount") & "'"
set rs=server.CreateObject("adodb.recordset")
'Response.Write(sql)
'Response.End()
rs.open sql,conn,3,1
if rs.recordcount>0 then Response.write("true")
else
Response.write("false")
end if
rs.close
set rs=nothing
set conn=nothing