Fix JS error and allow focus of Other Amount field
authorChristian Wach <needle@haystack.co.uk>
Wed, 17 Jan 2024 13:41:19 +0000 (13:41 +0000)
committereileen <emcnaughton@wikimedia.org>
Sat, 27 Jan 2024 07:37:21 +0000 (20:37 +1300)
templates/CRM/Contribute/Form/Contribution/Main.tpl

index d44bd2b60028e7763084cab804f3d15ac7708f06..054776ad3df1e25bbc011cf75521fee02bbd28ef 100644 (file)
@@ -23,6 +23,9 @@
         if ( element.type == 'radio' && element.name === mainPriceFieldName ) {
           if (element.value == '0' ) {
             element.checked = true;
+            // Copied from `updatePriceSetHighlight()` below which isn't available here.
+            cj('#priceset .price-set-row span').removeClass('highlight');
+            cj('#priceset .price-set-row input:checked').parent().addClass('highlight');
           }
           else {
             element.checked = false;
       var isRecur = cj('input[id="is_recur"]:checked');
 
       var quickConfig = {/literal}'{$quickConfig}'{literal};
-      if (cj("#auto_renew") && quickConfig) {
+      if (cj("#auto_renew").length && quickConfig) {
         showHideAutoRenew(null);
       }