在表单提交上禁用提交按钮的问题 [英] Problem with disabling submit buttons on form submit

查看:117
本文介绍了在表单提交上禁用提交按钮的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

问候

我在提交插件上使用jquery disable但是我遇到了问题。如果我禁用提交按钮,他们不会传回服务器,所以我不知道按下了哪个按钮。这是正常的吗?我有什么可以做的吗?

I am using the jquery disable on submit plug-in but I have a problem. If I disable the submit buttons they dont get passed back to the server so I cant tell which button was pressed. Is this normal? Is there anything I can do about it?

我真的不想重新调整我的网站,所以我必须在表单提交上设置一个变量来告诉按下哪个按钮。

I really dont want to retool my website so I have to set a variable on form submission to tell which button was pressed.

任何想法?

推荐答案

这是我刚才找到的解决方法a href =http://groups.google.com/group/jquery-en/browse_thread/thread/428f1d3c5f459506?pli=1 =nofollow noreferrer>一个jQuery论坛:

Here's a workaround I just found in a jQuery forum:

<script type="text/javascript">
    $(document).ready(function() {
        $("#sendSearch").click(function() {
            $('#loadingDiv').show();
            $('#sendSearch').attr("disabled", "disabled");

            // these two lines are the workaround
            this.form.submit();
            return true;
        });
    });
</script>

这篇关于在表单提交上禁用提交按钮的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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