2010-11-23 132 views
6

我們有一個提交按鈕(input type =「submit」)和一堆a4j:commandButtons,它們是將輸入類型=「按鈕」轉換爲ajax按鈕的表單。防止與a4j雙重提交:commandButton

我能夠使用這個jQuery代碼,以防止提交按鈕的雙提交:被多次提交CommandButton控件:

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

但如何才能使我也禁用A4J?

謝謝。

回答

7

端起來將這些屬性添加到A4J:的commandButton:

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