// Exhibitor additional space var FIELD = '[id^=field_mq6hn]'; var ATTENDEE_EXIBITOR = '[id^=field_iu0wn]'; function handle_additional_space(){ console.log("In HANDLER"); var space_selector = FIELD+'[id$=-4]'; var additional_space = jQuery(space_selector); var usual_booth = jQuery(FIELD+':checked').not(additional_space); if (usual_booth.length == 0){ additional_space.hide().prop('checked',false); } else { additional_space.show(); usual_booth.closest('.frm_repeat_sec').find(space_selector).hide(); } } jQuery(function(){ jQuery(FIELD).change(function(){ handle_additional_space(); }); jQuery(ATTENDEE_EXIBITOR).change(function(){ handle_additional_space(); }) })