I want to prevent someone from clicking this button twice and triggering two form submissions which could result in duplicate payments on the server:
$("#SUBMIT_PAYMENT").button(
{
label: "SUBMIT PAYMENT",
text: true
});
Is there an option to make a jQueryUI button automatically disable itself aft开发者_JS百科er it is clicked?
I don't have much experience with UI, but this might work:
$("#SUBMIT_PAYMENT").button(
{
label: "SUBMIT PAYMENT",
text: true
}).one('click', function() {
$(this).button('disable');
});
精彩评论