diff --git a/commerce_datatrans.js b/commerce_datatrans.js index de87ac30d337cf9317cbcfece8742a853c624124..11d3e7962d64130a8cb6f0dca4399b68ad6e9468 100644 --- a/commerce_datatrans.js +++ b/commerce_datatrans.js @@ -7,9 +7,11 @@ // multiple triggers. $('#paymentButton', context).once('datatrans', function() { $(this).click(function () { - $('form').submit(function (e) { + var disableSubmit = function(e) { e.preventDefault(); - }); + }; + + $('form').bind('submit', disableSubmit); Datatrans.startPayment({ // Use the class selector here and not the id selector because of @@ -23,6 +25,10 @@ // @see commerce_checkout.js $(this.form + '[disabled]').remove(); $(this.form).show(); + + // Also re-enable the form again, in case the user wants to proceed + // with another payment option. + $('form').unbind('submit', disableSubmit); } }); });