<SCRIPT language=JavaScript>
<!--
function check(value)
{
window.open("checkuser.asp?username="+value,"",'toolbar=no,directories=no,scrollbars=0,resizable=1,status=no,menubar=0,width=250,height=100');
}
-->
</SCRIPT>
<form method="POST" action="regsave.asp" name="form1" onSubmit="return test();">
用户名:<input type="text" name="username" size="20" maxlength="12" tabindex="1">
<input type="button" name="button1" onclick="check(document.form1.username.value)" value="查看用户名是否可用" />
</form>
验证页面 checkuser.asp
------------------------------------------------------
<!--#i nclude file="conn.asp"-->
<%if request("username")="" then
response.write"<SCRIPT language=JavaScript>alert('对不起!请输入你的帐号!');javascript:window.close();</SCRIPT>"
end if
if len(request("username"))<4 then
response.write"<SCRIPT language=JavaScript>alert('输入的帐号至少为4位数!');javascript:window.close();</SCRIPT>"
end if
%>
<%dim username,sql
username=request("username")
sql="select * from dv_user where username='"&username&"'"
rst.open sql,conn,1,3
%>
<% if not rst.eof then
response.write "<p align='center'><font color=#ff0000 size=2>对不起!此帐号已被人注册,请您另选帐号!</font></p><br>"
response.write "<p align='center'><a href='javascript:window.close()' class='A02'>关闭窗口</a></p>"
else
response.write "<p align='center'><font color=#ff0000 size=2>恭喜你!此帐号无人使用,请继续注册!</font></p><br>"
response.write "<p align='center'><a href='javascript:window.close()' class='A02'>关闭窗口</a></p>"
end if%>
他这里是个点击事件,你可以把事件修改一下
<SCRIPT language=JavaScript>
<!--
function onblur(value)
{
window.open("checkuser.asp?username="+value,"",'toolbar=no,directories=no,scrollbars=0,resizable=1,status=no,menubar=0,width=250,height=100');
}
-->
</SCRIPT>
<form method="POST" action="regsave.asp" name="form1" onSubmit="return test();">
用户名:<input type="text" name="username" size="20" maxlength="12" tabindex="1" onblur="check(document.form1.username.value)" >
</form>
验证页面 checkuser.asp
------------------------------------------------------
<!--#i nclude file="conn.asp"-->
<%if request("username")="" then
response.write"<SCRIPT language=JavaScript>alert('对不起!请输入你的帐号!');javascript:window.close();</SCRIPT>"
end if
if len(request("username"))<4 then
response.write"<SCRIPT language=JavaScript>alert('输入的帐号至少为4位数!');javascript:window.close();</SCRIPT>"
end if
%>
<%dim username,sql
username=request("username")
sql="select * from dv_user where username='"&username&"'"
rst.open sql,conn,1,3
%>
<% if not rst.eof then
response.write "<p align='center'><font color=#ff0000 size=2>对不起!此帐号已被人注册,请您另选帐号!</font></p><br>"
response.write "<p align='center'><a href='javascript:window.close()' class='A02'>关闭窗口</a></p>"
else
response.write "<p align='center'><font color=#ff0000 size=2>恭喜你!此帐号无人使用,请继续注册!</font></p><br>"
response.write "<p align='center'><a href='javascript:window.close()' class='A02'>关闭窗口</a></p>"
end if%>
他这里是个点击事件,你可以把事件修改一下