asp 提交按钮执行了两次事件

Lizhiqino1 2009-08-15 04:12:02
提交页面:
循环生成N多带编号的图片提交按钮:
<td bgcolor="#00FFFF" valign="middle"><div align="left" class="style1"><a title="<% = FindSum(C1) %>"><input type ="image" name = "BTEnter" value = <%= C1 %> src=<% = GetFileName(C1,"C") %> onclick="this.form.action=this.form.action+'?action=<%= C1 %>';this.form.submit()"></title></div></td>
<td bgcolor="#00FFFF" valign="middle"><div align="left" class="style1"><a title="<% = FindSum(C2) %>"><input type ="image" name = "BTEnter" value = <%= C2 %> src=<% = GetFileName(C2,"C") %> onclick="this.form.action=this.form.action+'?action=<%= C2 %>';this.form.submit()"></title></div></td>
...
接受处理事件
strSQL = "Select * From UserClicks Where 1 = 0 "
rstUsersClicks.Open strSQL,conn,1,2
intPoints = rstUsers("ClickTimes")
rstUsersClicks.AddNew
rstUsersClicks("IDNo") = rstUsers("IDNO")
rstUsersClicks("BlockNo") = strBlockNo
rstUsersClicks("ClickDate") = Date() + Time()
rstUsersClicks("ClickTimes") = rstUsers("ClickTimes") - 1
rstUsersClicks("ClickType") = 1
rstUsersClicks("PurchasePoints") = 1
rstUsersClicks("IPAddress") = GetIP()
rstUsersClicks.Update

rstUsersClicks一下就生成了2个相同时间内插入的记录真头痛,谁能帮忙解决下?谢谢了!!
补充:不过如果换成一般提交按钮就没问题,为什么呢???
...全文
37 点赞 收藏 1
写回复
1 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
in0512 2009-08-15
<input type ="image" name = "BTEnter" value = <%= C1 %> src= <% = GetFileName(C1,"C") %> onclick="this.form.action=this.form.action+'?action= <%= C1 %>';this.form.submit()">

本身就是提交按钮

可以把this.form.submit()去掉
回复
相关推荐
发帖
ASP
创建于2007-09-28

2.8w+

社区成员

ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
申请成为版主
帖子事件
创建了帖子
2009-08-15 04:12
社区公告
暂无公告