CRM-16555 - Fix paymentBlock js for front-end forms
authorColeman Watts <coleman@civicrm.org>
Tue, 2 Jun 2015 19:20:10 +0000 (15:20 -0400)
committerColeman Watts <coleman@civicrm.org>
Tue, 2 Jun 2015 20:25:42 +0000 (16:25 -0400)
templates/CRM/common/paymentBlock.tpl

index 4131f829a20c2cafafae99c329840bbfe1eaefbe..54016083e4ae7851d4fc2ae92ddf24722f04d4d7 100644 (file)
@@ -59,8 +59,8 @@ function buildPaymentBlock(type) {
 
 CRM.$(function($) {
     $('.crm-group.payment_options-group').show();
-
-    $('#payment_processor_id').change( function() {
+    // FIXME: This code is getting re-loaded and re-run every time, using .off() as a temporary fix
+    $('[name=payment_processor_id]').off('.paymentBlock').on('change.paymentBlock', function() {
         buildPaymentBlock( $(this).val() );
     });
 });