diff --git a/pinaxcon/templates/registrasion/stripe/credit_card_payment.html b/pinaxcon/templates/registrasion/stripe/credit_card_payment.html index 6bbaa86db73d5b3efe6fe9a3c1d4c3060bf3a8c7..d46d56caca05b42ab586bea487c5cd5c2ae8290a 100644 --- a/pinaxcon/templates/registrasion/stripe/credit_card_payment.html +++ b/pinaxcon/templates/registrasion/stripe/credit_card_payment.html @@ -35,13 +35,14 @@ function stripeResponseHandler(status, response) { // Grab the form: var $form = $('#payment-form'); + var $submit = $form.find('input[type=submit]') if (response.error) { // Problem! console.log(response.error.message); // Show the errors on the form: $form.find('#payment-errors').text(response.error.message); $form.find('#payment-errors-outer').show(); - $form.find('input[type=submit]').prop('disabled', false); // Re-enable submission + $submit.prop('disabled', false); // Re-enable submission } else { // Token was created! console.log(response); @@ -53,8 +54,11 @@ $form = $form.append($('').val(token)); // Submit the form: - $form.find('input[type=submit]').prop('disabled', false); - $form.find('input[type=submit]').click(); + + $submit.prop('disabled', false); + $submit.click(); + $submit.prop('disabled', true); + $form.append($('

').text("Processing your payment. Please do not refresh.")); } };