From 6e56bbfcb7ca331a1cbcd6fb30b6ec2433877f3e Mon Sep 17 00:00:00 2001
From: Coleman Watts <coleman@civicrm.org>
Date: Sat, 30 Mar 2013 16:53:13 -0700
Subject: [PATCH] Hide payment options if js disabled CRM-12149

---
 templates/CRM/Contribute/Form/Contribution/Main.tpl | 3 ++-
 templates/CRM/common/paymentBlock.tpl               | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/templates/CRM/Contribute/Form/Contribution/Main.tpl b/templates/CRM/Contribute/Form/Contribution/Main.tpl
index 52586d6409..17d67d4bb5 100644
--- a/templates/CRM/Contribute/Form/Contribution/Main.tpl
+++ b/templates/CRM/Contribute/Form/Contribution/Main.tpl
@@ -273,7 +273,8 @@
   {/if}
 
   {if $form.payment_processor.label}
-  <fieldset class="crm-group payment_options-group">
+  {* PP selection only works with JS enabled, so we hide it initially *}
+  <fieldset class="crm-group payment_options-group" style="display:none;">
     <legend>{ts}Payment Options{/ts}</legend>
     <div class="crm-section payment_processor-section">
       <div class="label">{$form.payment_processor.label}</div>
diff --git a/templates/CRM/common/paymentBlock.tpl b/templates/CRM/common/paymentBlock.tpl
index a11a7f551e..6d75285acb 100644
--- a/templates/CRM/common/paymentBlock.tpl
+++ b/templates/CRM/common/paymentBlock.tpl
@@ -60,6 +60,8 @@ function buildPaymentBlock( type ) {
 }
 
 cj( function() {
+    cj('.crm-group.payment_options-group').show();
+
     cj('input[name="payment_processor"]').change( function() {
         buildPaymentBlock( cj(this).val() );
     });
-- 
GitLab