Merge pull request #8470 from ankitjain28may/master
[civicrm-core.git] / templates / CRM / Core / BillingBlock.tpl
index c46a2b36bde8ef4998879431c4ea242d889dc041..0d9171ac46b49e0f6c8c0646888385e5a63aa928 100644 (file)
@@ -2,7 +2,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 4.7                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2015                                |
+ | Copyright CiviCRM LLC (c) 2004-2016                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
       });
     });
 
-    $('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();
-        }
-      }
-      toggleConfirmButton();
-    });
-
   </script>
   {/literal}
 {/if}
+{if $suppressSubmitButton}
+{literal}
+  <script type="text/javascript">
+    CRM.$(function($) {
+      $('.crm-submit-buttons', $('#billing-payment-block').closest('form')).hide();
+    });
+  </script>
+{/literal}
+{/if}
 {/crmRegion}
 {crmRegion name="billing-block-post"}
   {* Payment processors sometimes need to append something to the end of the billing block. We create a region for