admin管理员组

文章数量:1328558

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"

本文标签: javascriptPrevent double submit with a4jcommandButtonStack Overflow