救救,我怎么设置都不能调用我的事件。。。

mysite365 2008-04-12 08:55:32
<form id="form1" name="form1" method="post" onSubmit="return checkreg();" action="">

<table width="98%" cellpadding="4" cellspacing="0" style="border:4px solid #EAFCE6;">
<tr>
<td height="23" align="left"><span class="STYLE4">用户名和密码:</span></td>
</tr>
<tr bgcolor="#EAFCE6">
<td height="29" bgcolor="#EAFCE6" align="left"><font color="#CC0000">*</font> 用 户 名:
<input type="text" name="username" size="18" maxlength="20" >
<input type="button" name="check" value="检测用户" tabindex="50">

支持中文,不支持特殊符号如:*%#!-&%$</td>
</tr>
大家看看,我怎么设置都不能调用我的事件。。。
<%
if not isempty (request.Form("check")) then if request.Form("username")<>""then
set rs=server.createobject("adodb.recordset")
rs.open "select username from [bout_user] where username='"&str_filter(request.Form("username"))&"'",conn,1,3
if rs.eof then
response.Write("<script language='javascript'>arert('此用户可以使用!');</script>")
else
response.Write("<script language='javascript'>arert('此用户已存在,请重新输入!');</script>")
end if
rs.close
set rs=nothing
else
response.Write("<script language='javascript'>arert('请输入用户名!');</script>")
end if
end if

if not isempty (request.Form("sumbit")) then call reg_check()
end if
%>
上面为事件,,,大家帮忙看看问题,在哪里。。。。。。。。。。。
...全文
105 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
hookee 2008-04-12
  • 打赏
  • 举报
回复
你的意图是不是检测用户但不刷新页面?不刷新页面并不是将<%%>写在同一页面来实现的。
要检测用户还是需要递交数据到服务器端

可以这么做
主页面(iframe) 递交用户名到iframe窗口 xxx.asp, xxx.asp查数据库并返回js脚本提示是否成功
mysite365 2008-04-12
  • 打赏
  • 举报
回复
2楼的,我的
<%
if not isempty (request.Form("check")) then if request.Form("username") <>""then
set rs=server.createobject("adodb.recordset")
rs.open "select username from [bout_user] where username='"&str_filter(request.Form("username"))&"'",conn,1,3
if rs.eof then
response.Write(" <script language='javascript'>arert('此用户可以使用!'); </script>")
else
response.Write(" <script language='javascript'>arert('此用户已存在,请重新输入!'); </script>")
end if
rs.close
set rs=nothing
else
response.Write(" <script language='javascript'>arert('请输入用户名!'); </script>")
end if
end if
%>
这里只是页内调用我的ASP代码,需要下面修改吗?
<input type="submit" name="check" value="检测用户" tabindex="50">
要不然表单都根本没有提交

我照你的说话修改一样,没有起到检测用户的作用,我这里,只是检测,用户填写的用户名是否存在,并没有要把整个表单提交,进行写入数据库。。。
wood_horse 2008-04-12
  • 打赏
  • 举报
回复
同上
小逗狗 2008-04-12
  • 打赏
  • 举报
回复
<input type="button" name="check" value="检测用户" tabindex="50">
改成
<input type="submit" name="check" value="检测用户" tabindex="50">
要不然表单都根本没有提交
hookee 2008-04-12
  • 打赏
  • 举报
回复
<%
If Request.ServerVariables("REQUEST_METHOD")="POST" Then
...
End If
%>

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧