From fa3d733582670d3107c1839485e478e62560aaaa Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Wed, 27 Jan 2016 16:20:23 -0500 Subject: [PATCH] CRM-17886 - Fix contribution page toggleSubmitButton js --- templates/CRM/Core/BillingBlock.tpl | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/templates/CRM/Core/BillingBlock.tpl b/templates/CRM/Core/BillingBlock.tpl index c46a2b36bd..adc489308d 100644 --- a/templates/CRM/Core/BillingBlock.tpl +++ b/templates/CRM/Core/BillingBlock.tpl @@ -202,27 +202,13 @@ .replace(/-/g, ''); $('#credit_card_number').val(cc); }); - }); - $('input[name="payment_processor_id"]').change( function() { function toggleConfirmButton() { var suppressSubmitButton = {/literal}"{$suppressSubmitButton}"{literal}; - var elementObj = $('input[name="payment_processor"]'); - if ( elementObj.attr('type') == 'hidden' ) { - var processorTypeId = elementObj.val( ); - } - else { - var processorTypeId = elementObj.filter(':checked').val(); - } - - if (suppressSubmitButton) { - $("#crm-submit-buttons").hide(); - } - else { - $("#crm-submit-buttons").show(); - } + $("#crm-submit-buttons").toggle(!suppressSubmitButton); } toggleConfirmButton(); + $('input[name="payment_processor_id"]').change(toggleConfirmButton); }); -- 2.25.1