Prevent double submit with a4j:commandButton

只愿长相守 提交于 2019-12-23 09:26:53

问题


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".

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

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

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

Thanks.


回答1:


Ended up adding these attributes to the a4j:commandButton:

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


来源:https://stackoverflow.com/questions/4260319/prevent-double-submit-with-a4jcommandbutton

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!