Support

Home Forums Event Espresso Premium Conditional Logic For Multiple Registrants

Conditional Logic For Multiple Registrants

Posted: July 5, 2022 at 4:43 am

Viewing 1 reply thread


Think Solutions

July 5, 2022 at 4:43 am

Hey Guys!

So I have been working on some conditional logic fields for my equestrian event registration forms. And from looking through some previous posts I have managed to get it working (Thank God!), one issue I am running into though is that each person will be registering multiple horses for each event but when it triggered the conditional logic, it would trigger it for all registration forms. I have managed to figure out how to specify which registration form to trigger the conditional logic on, see line 5, ‘ee-registration-2’, for the second registration form. However I want to be able to do this an infinit amount of times without having to copy and paste parts of this snippet for ee-registration-3, ee-registration-4 etc.


function ee_custom_show_question_conditionally() {
wp_add_inline_script(
'ee_form_section_validation',
'jQuery( document ).ready(function($) {
var text = $("fieldset[id^=\'ee-registration-2\'] .ee-reg-qstn-16-input-dv");
$(text).hide();
$("fieldset[id^=\'ee-registration-2\'] .ee-reg-qstn-57").change(function() {
$(this).val() == "No" ?
$(text).show() :
$(text).hide();
});
});'
);
}
add_action(
'wp_enqueue_scripts',
'ee_custom_show_question_conditionally',
11
);

Any help on making this more efficient would be greatly appreciated 🙂


Joao Victor

  • Support Staff

July 5, 2022 at 4:44 pm

Hi there!

Thanks for reaching out.

I understand this functionality is crucial to your event, but it requires code customization which is not covered by our support (we are able to cover small customizations, but this one is more detailed and specific). As we are not offering customization services, you can consult our Event Espresso Consultants: https://eventespresso.com/developers/event-espresso-pros/

Viewing 1 reply thread

The support post ‘Conditional Logic For Multiple Registrants’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso