简体   繁体   English

使用a4j:commandButton阻止双重提交

[英]Prevent double submit with 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". 我们有一个表单,其中有一个提交按钮(输入类型=“提交”)和一堆a4j:commandButtons,它们是转换为输入类型=“按钮”的ajax按钮。

I'm able to use this jquery code to prevent double submitting of the submit button: 我可以使用这个jquery代码来防止提交按钮的双重提交:

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

But how can I also disable the a4j:commandButtons from being submitted more than once? 但是我怎样才能禁止a4j:commandButtons被多次提交?

Thanks. 谢谢。

结束将这些属性添加到a4j:commandButton:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM