From: Coleman Watts Date: Wed, 27 Jan 2016 21:20:23 +0000 (-0500) Subject: CRM-17886 - Fix contribution page toggleSubmitButton js X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=fa3d733582670d3107c1839485e478e62560aaaa;p=civicrm-core.git CRM-17886 - Fix contribution page toggleSubmitButton js --- 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); });