CRM-16093 - Fix js error on participant form
authorColeman Watts <coleman@civicrm.org>
Wed, 11 Mar 2015 18:10:53 +0000 (14:10 -0400)
committerColeman Watts <coleman@civicrm.org>
Wed, 11 Mar 2015 18:10:53 +0000 (14:10 -0400)
CRM/Event/Form/EventFees.php
templates/CRM/Event/Form/Participant.tpl

index 898bbf90405a8a7d589dca2a082b7787153741ee..e102ec4831d28a440aa4957fff49bd89e928115e 100644 (file)
@@ -393,7 +393,7 @@ SELECT  id, html_type
           array(
             0 => ts('- select -')) + $discounts,
           FALSE,
-          array('onchange' => "buildFeeBlock( {$form->_eventId}, this.value );")
+          array('class' => "crm-select2")
         );
 
         if ($form->_online) {
index 3c5822baf1d15d38abab20aadf0f53a2d1a44035..2858c322b8c952b6c635433e2df9ac80c3ae3814 100644 (file)
         if ($('#discount_id', $form).val()) {
           buildFeeBlock($('#discount_id', $form).val());
         }
+        $($form).on('change', '#discount_id', function() {
+          buildFeeBlock($(this).val());
+        });
 
         function buildRoleCustomData() {
           var roleId = $('select[name^=role_id]', $form).val().join();