From: Coleman Watts Date: Wed, 22 Oct 2014 18:39:00 +0000 (-0400) Subject: CRM-15483 - Fix js loading event form fee block X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=ab421ec68f909a7885d8f539ace2b868d50f05c9;p=civicrm-core.git CRM-15483 - Fix js loading event form fee block --- diff --git a/templates/CRM/Event/Form/Participant.tpl b/templates/CRM/Event/Form/Participant.tpl index 158cf90985..109767ebc6 100644 --- a/templates/CRM/Event/Form/Participant.tpl +++ b/templates/CRM/Event/Form/Participant.tpl @@ -301,7 +301,7 @@ {/if} {* Fee block (EventFees.tpl) is injected here when an event is selected. *} -
+
@@ -399,20 +399,14 @@ {/if} {literal} - var eventId = $('#event_id').val(); - - {/literal}{if $action eq 2}{literal} - if (typeof eventId == 'undefined') { - var eventId = $('[name=event_id]').val(); - } - {/literal}{/if}{literal} + var eventId = $('[name=event_id], #event_id', $form).val(); if (eventId) { dataUrl += '&eventId=' + eventId; } else { - $('#eventFullMsg').hide( ); - $('#feeBlock').html(''); + $('#eventFullMsg', $form).hide( ); + $('.crm-event-form-fee-block', $form).html(''); return; } @@ -429,13 +423,13 @@ $.ajax({ url: dataUrl, success: function ( html ) { - $("#feeBlock").html( html ).trigger('crmLoad'); + $(".crm-event-form-fee-block", $form).html( html ).trigger('crmLoad'); //show event real full as well as waiting list message. - if ( $("#hidden_eventFullMsg").val( ) ) { - $( "#eventFullMsg" ).show( ).html( $("#hidden_eventFullMsg" ).val( ) ); + if ( $("#hidden_eventFullMsg", $form).val( ) ) { + $( "#eventFullMsg", $form).show( ).html( $("#hidden_eventFullMsg", $form).val( ) ); } else { - $( "#eventFullMsg" ).hide( ); + $( "#eventFullMsg", $form ).hide( ); } } });