Merge pull request #4193 from colemanw/CRM-15342
[civicrm-core.git] / templates / CRM / Price / Form / Field.tpl
index 986d332ad88b106fcc8d7bbb8a286c6b3a57a8a2..4c678b322c340d399476006a734f118cd7341c3a 100644 (file)
@@ -1,8 +1,8 @@
 {*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.4                                                |
+ | CiviCRM version 4.5                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013                                |
+ | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
 {literal}
 <script type="text/Javascript">
   function option_html_type(form) {
-    var html_type = document.getElementById("html_type");
-    var html_type_name = html_type.options[html_type.selectedIndex].value;
+    var html_type_name = cj('#html_type').val();
 
     if (html_type_name == "Text") {
-      document.getElementById("price-block").style.display="block";
-      document.getElementById("showoption").style.display="none";
+      cj("#price-block").show();
+      cj("#showoption").hide();
 
     }
     else {
-      document.getElementById("price-block").style.display="none";
-      document.getElementById("showoption").style.display="block";
+      cj("#price-block").hide();
+      cj("#showoption").show();
     }
 
     if (html_type_name == 'Radio' || html_type_name == 'CheckBox') {
     var radioOption, checkBoxOption;
 
     for (var i=1; i<=15; i++) {
-      radioOption = 'radio'+i;
-      checkBoxOption = 'checkbox'+i
+      radioOption = '#radio'+i;
+      checkBoxOption = '#checkbox'+i;
       if (html_type_name == 'Radio' || html_type_name == 'CheckBox' || html_type_name == 'Select') {
         if (html_type_name == "CheckBox") {
-          document.getElementById(checkBoxOption).style.display="block";
-          document.getElementById(radioOption).style.display="none";
+          cj(checkBoxOption).show();
+          cj(radioOption).hide();
         }
         else {
-          document.getElementById(radioOption).style.display="block";
-          document.getElementById(checkBoxOption).style.display="none";
+          cj(radioOption).show();
+          cj(checkBoxOption).hide();
         }
       }
     }
@@ -68,7 +67,6 @@
   }
 </script>
 {/literal}
-<h3>{if $action eq 1}{ts}Add Field{/ts}{elseif $action eq 2}{ts}Edit Field{/ts}{/if}</h3>
 <div class="crm-block crm-form-block crm-price-field-form-block">
   <div class="crm-submit-buttons">{include file="CRM/common/formButtons.tpl" location="top"}</div>
   <table class="form-layout">