prevent双带A4J提交:的commandButton [英] Prevent double submit with a4j:commandButton

查看:266
本文介绍了prevent双带A4J提交:的commandButton的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们必须有一个提交按钮(INPUT TYPE =提交)和一堆A4J形式:CommandButton控件这是阿贾克斯的按钮,并转化为输入型=按钮。

We have a form which has a submit button (input type="submit") and a bunch of a4j:commandButtons which are ajax buttons that translate into input type="button".

我能够使用这个jQuery code的提交按钮的prevent双提交:

I'm able to use this jquery code to prevent double submitting of the submit button:

         $('#createPostingForm').submit(function(){
          $(':submit').click(function() {  
                 return false;  
          });
        }); 

但我怎么也禁用A4J:从多次提交更多的CommandButton控件

But how can I also disable the a4j:commandButtons from being submitted more than once?

感谢。

推荐答案

最终将这些属性的A4J:的commandButton:

Ended up adding these attributes to the a4j:commandButton:

onclick="this.disabled=true" oncomplete="this.disabled=false"

这篇关于prevent双带A4J提交:的commandButton的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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