最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Prevent double submit with a4j:commandButton - Stack Overflow

programmeradmin5浏览0评论

We have a form which has a submit button (input type="submit") and a bunch of a4j:mandButtons 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:mandButtons from being submitted more than once?

Thanks.

We have a form which has a submit button (input type="submit") and a bunch of a4j:mandButtons 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:mandButtons from being submitted more than once?

Thanks.

Share Improve this question edited Nov 23, 2010 at 20:07 RichFaces4Life asked Nov 23, 2010 at 20:01 RichFaces4LifeRichFaces4Life 1411 silver badge5 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 8

Ended up adding these attributes to the a4j:mandButton:

onclick="this.disabled=true" onplete="this.disabled=false"
发布评论

评论列表(0)

  1. 暂无评论