问题
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