From ab421ec68f909a7885d8f539ace2b868d50f05c9 Mon Sep 17 00:00:00 2001 From: Coleman Watts Date: Wed, 22 Oct 2014 14:39:00 -0400 Subject: [PATCH] CRM-15483 - Fix js loading event form fee block --- templates/CRM/Event/Form/Participant.tpl | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) 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( ); } } }); -- 2.25.1