过滤或避免双击表单提交 [英] Filtering or avoiding double click on form submission

查看:61
本文介绍了过滤或避免双击表单提交的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尽管在网上搜索,我找不到一个合适的解决方案,可以阻止用户双击提交表单两次。我正在按钮元素中使用

跟随:


< input type =" button" onclick =" this.disabled = true; this.form.submit();">


虽然它可以防止多次单击,但它不够好快速

双击,例如在一些多按钮鼠标上找到的。


任何人有更好的解决方案吗?


-

Ed Jay(删除''M''通过电子邮件回复)


赢得抗击乳腺癌的战争。

了解事实可以挽救你的生命。
http://www.breastthermography.info

Despite searching the net, I can''t find a suitable solution that prevents a
user''s double click from submitting a form twice. I''m currently using the
following in a button element:

<input type="button" onclick="this.disabled=true;this.form.submit();">

While it prevents multiple single clicks, it isn''t good enough for a fast
double click, such as found on some multi-button mice.

Anyone have a better solution?

--
Ed Jay (remove ''M'' to reply by email)

Win the War Against Breast Cancer.
Knowing the facts could save your life.
http://www.breastthermography.info

推荐答案

10月15日12:01 * am,Ed Jay写道:
On Oct 15, 12:01*am, Ed Jay wrote:

尽管在网上搜索,但我找不到一个合适的解决方案,可以防止用户双击提交表单两次
用户双击。我正在按钮元素中使用

跟随:

< input type =" button" onclick =" this.disabled = true; this.form.submit();">

虽然它可以防止多次单击,但对于快速

双击,例如在某些多按钮鼠标上找到的。
Despite searching the net, I can''t find a suitable solution that preventsa
user''s double click from submitting a form twice. I''m currently using the
following in a button element:
<input type="button" onclick="this.disabled=true;this.form.submit();">
While it prevents multiple single clicks, it isn''t good enough for a fast
double click, such as found on some multi-button mice.



看看
http://www.dynamicdrive.com/dynamici...submitonce.htm


我不知道所有鼠标是否足够快,

和使用猫不会很好。

Have a look at
http://www.dynamicdrive.com/dynamici...submitonce.htm

I do not know if is fast enough for all mice,
and using cats would not be very nice.


Ed Jay写道:
Ed Jay wrote:

尽管在网上搜索,我找不到一个合适的解决方案,可以防止用户双击提交表单两次。我正在按钮元素中使用

跟随:


< input type =" button" onclick =" this.disabled = true; this.form.submit();">
Despite searching the net, I can''t find a suitable solution that prevents a
user''s double click from submitting a form twice. I''m currently using the
following in a button element:

<input type="button" onclick="this.disabled=true;this.form.submit();">



使用提交按钮,不要打电话给我。 form.submit();


< input type =" button" onclick =" this.disabled = true;">


这样可以在未启用js时访问该表单。


什么用户的连接在用户填写表单之后,但在按下提交之前停止了吗?


如果您使用过无线网络连接,你毫无疑问遇到了这个问题。这是一个很糟糕的效果,我记得曾多次体验过GG和GMail




Garrett


-

comp.lang.javascript常见问题<网址: http:/ /jibbering.com/faq/ >

Use a submit button and don''t call this.form.submit();

<input type="button" onclick="this.disabled=true;">

This makes the form accessible when js is not enabled.

What happens when the user''s connection drops after the user fills out
the form, but before pressing submit?

If you''ve used a wireless connection, you''ve no doubt run into that
problem. It''s a bad effect that I remember experiencing on GG and GMail
many times.

Garrett

--
comp.lang.javascript FAQ <URL: http://jibbering.com/faq/ >


dhtml写道:
dhtml wrote:

Ed Jay写道:
Ed Jay wrote:

>尽管在网上搜索,但我找不到一个合适的解决方案来阻止
用户的双击从提交表格两次。我正在按钮元素中使用
以下内容:

< input type =" button" onclick =" this.disabled = true; this.form.submit();">
>Despite searching the net, I can''t find a suitable solution that
prevents a
user''s double click from submitting a form twice. I''m currently using the
following in a button element:

<input type="button" onclick="this.disabled=true;this.form.submit();">



使用提交按钮,不要打电话给它。 form.submit();


< input type =" button" onclick =" this.disabled = true;">


Use a submit button and don''t call this.form.submit();

<input type="button" onclick="this.disabled=true;">



我的意思是:


< input type = [提交" onclick =" this.disabled = true;">

I meant:

<input type="submit" onclick="this.disabled=true;">


这样可以在未启用js时访问该表单。


用户的连接在用户填写表单之后,但在按提交之前停止后会发生什么?


如果你''我们使用无线连接,毫无疑问会遇到这个问题。这是一个很糟糕的效果,我记得经历过GG和GMail

多次。
This makes the form accessible when js is not enabled.

What happens when the user''s connection drops after the user fills out
the form, but before pressing submit?

If you''ve used a wireless connection, you''ve no doubt run into that
problem. It''s a bad effect that I remember experiencing on GG and GMail
many times.



所以可以替换为:

< input type =" submit">


如果您需要在服务器上过滤双重请求,请将隐藏在
$ b中$ b表格。当令牌到来时,你已收到你的请求。随后可以忽略带有该令牌的
提交。


Garrett

So can be replaced with:
<input type="submit">

If you need to filter double requests on the server, put a hidden in the
form. When the token comes, you''ve got your request. Subsequent
submissions with that token can be ignored.

Garrett


Garrett
Garrett



-

comp.lang.javascript FAQ< URL: http://jibbering.com/faq/ >


--
comp.lang.javascript FAQ <URL: http://jibbering.com/faq/ >


这篇关于过滤或避免双击表单提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆