CRM-15932 - Fix recurringEntity form validation
authorColeman Watts <coleman@civicrm.org>
Sun, 8 Mar 2015 02:39:11 +0000 (21:39 -0500)
committerColeman Watts <coleman@civicrm.org>
Sun, 8 Mar 2015 02:39:11 +0000 (21:39 -0500)
templates/CRM/Core/Form/RecurringEntity.tpl

index c25626516ababb7c8158c3f921199770adcee19b..d85e499f9e5ac84f84a527374eb516c07d69be07 100644 (file)
     $('#repetition_frequency_unit', $form).each(changeFrequencyUnit).change(changeFrequencyUnit);\r
 \r
     function disableUnselected() {\r
-      $('input:radio[name=ends], input[name=repeats_by]', $form).not(':checked').siblings(':input').prop('disabled', true);\r
+      $('input:radio[name=ends], input[name=repeats_by]', $form).not(':checked').siblings(':input').prop('disabled', true).removeClass('required');\r
     }\r
     disableUnselected();\r
 \r
       disableUnselected();\r
     });\r
 \r
+    $('input:radio[name=ends]').siblings('.crm-clear-link').click(function() {\r
+      $('input:radio[name=ends][value=1]').prop('checked', true).trigger('click');\r
+    });\r
+\r
     function validate() {\r
       var valid = $(':input', '#recurring-entity-block').valid(),\r
         modified = CRM.utils.initialValueChanged('#recurring-entity-block');\r