$this->add('select', 'additional_participants',
ts('How many people are you registering?'),
$additionalOptions,
- NULL,
- ['onChange' => "allowParticipant()"]
+ NULL
);
$isAdditionalParticipants = TRUE;
}
$buttonParams['name'] = ts('Register');
}
else {
- $buttonParams['name'] = ts('Review your registration');
+ $buttonParams['name'] = ts('Review');
$buttonParams['icon'] = 'fa-chevron-right';
}
<div class="crm-public-form-item crm-section additional_participants-section" id="noOfparticipants">
<div class="label">{$form.additional_participants.label} <span class="crm-marker" title="{ts}This field is required.{/ts}">*</span></div>
<div class="content">
- {$form.additional_participants.html}{if $contact_id || $contact_id == NULL}{ts}(including yourself){/ts}{/if}
+ {$form.additional_participants.html}{if $contact_id || $contact_id == NULL} {ts}(including yourself){/ts}{/if}
<br/>
- <span
- class="description">{ts}Fill in your registration information on this page. If you are registering additional people, you will be able to enter their registration information after you complete this page and click "Review your registration".{/ts}</span>
+ <div class="description" id="additionalParticipantsDescription" style="display: none;">{ts}Fill in your registration information on this page. You will be able to enter the registration information for additional people after you complete this page and click "Continue".{/ts}</div>
</div>
<div class="clear"></div>
</div>
{/if}
{literal}
+ CRM.$(function($) {
+ $('#additional_participants').change(function() {
+ toggleAdditionalParticipants();
+ allowParticipant();
+ });
+
+ function toggleAdditionalParticipants() {
+ var submit_button = $("#crm-submit-buttons > button").html();
+ var review_translated = '{/literal}{ts escape="js"}Review{/ts}{literal}';
+ var continue_translated = '{/literal}{ts escape="js"}Continue{/ts}{literal}';
+ if ($('#additional_participants').val()) {
+ $("#additionalParticipantsDescription").show();
+ $("#crm-submit-buttons > button").html(submit_button.replace(review_translated, continue_translated));
+ } else {
+ $("#additionalParticipantsDescription").hide();
+ $("#crm-submit-buttons > button").html(submit_button.replace(continue_translated, review_translated));
+ }
+ }
+ });
+
function allowParticipant() {
{/literal}{if $allowGroupOnWaitlist}{literal}
var additionalParticipants = cj('#additional_participants').val();