如果就是两个不一样的js话,那直接把一个js的名字修改一下,
然后在导入这个js的html页面把这个js的路径的名字改成你修改后的js文件名就可以了
这个很简单<%session("name")=request.form("name")
%>
<%set rslist=con.execute("select * from user where name = '"&session("name")&"'")%>
<%if not rslist.eof then %>
.
.The Name had Used! Please Input again!!!!
<% response.end %>
<% end if%>
另一种差不多:
StrSql = "select userid from sf_user where username = '" & ChkSql(request("username")) & "'"
Set rs2 = Conn.Execute(StrSql)
if not (rs2.bof or rs2.eof) then
response.write("用户存在了!")
response.end
end ifStrSql = "select userid from sf_user where username = '" & ChkSql(request("username")) & "'"
Set rs2 = Conn.Execute(StrSql)
if not (rs2.bof or rs2.eof) then
response.write("用户存在了!")
response.end
end ifStrSql = "select userid from sf_user where username = '" & ChkSql(request("username")) & "'"
Set rs2 = Conn.Execute(StrSql)
if not (rs2.bof or rs2.eof) then
response.write("用户存在了!")
response.end
end if
下边的内容是用JS判断的:
<a href="#" onclick="checkAccount(form1.UserAccount.value)return false"><font color="#990000">检查帐号</font></a>
然后把下面的funciton加到javascript中
function checkAccount(sValue){
if (sValue == "")
{
alert("请输入帐号")
return false
}
sUrl="chk_reg.asp?preuser="+sValue
sFeature="scrollbars=no,width=250,height=200,left=200,top=100"
oWin=window.open(sUrl,"single",sFeature)
}
然后chk_reg.asp中把preuser传过去的参数判断是否重复了,并显示相应的信息就行了
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<META Http-Equiv="Content-Type" Content="text/html charset=gb2312">
<SCRIPT LANGUAGE="JavaScript">
<!--
function ock_check(){
var obj=document.all.frm1
for(var i=0i<obj.usersName.lengthi++){
if(obj.usersName[i].value==obj.userName.value){
alert("此用户已经存在!")
return false
}else{
alert("可以使用此用户名!")
return
}
}
}
//-->
</SCRIPT>
</HEAD>
<BODY>
<FORM METHOD=POST ACTION="" name="frm1">
<!-- 此处可以用循环的方式将所有用户名输出在此
'rs.open "select userName from [user]",conn,1,1
do while
...
Response.write <INPUT TYPE='hidden' name='usersName' value='"&rs(0)&"'>
rs.movenext
loop
我在此处就简单写了
-->
<INPUT TYPE='hidden' name='usersName' value='wang'>
<INPUT TYPE='hidden' name='usersName' value='liang'>
<INPUT TYPE='hidden' name='usersName' value='huang'>
<INPUT TYPE='hidden' name='usersName' value='zhang'>
<INPUT TYPE="text" NAME="userName">
<INPUT TYPE="text" NAME="userPwd"><BR>
<INPUT TYPE="button" value="检查用户名" onclick="ock_check()">
</FORM>
</BODY>
</HTML>