$(window).load(function () { $(".custom-field-date input").datepicker({ minDate: null, dateFormat: 'mm/dd/yy', changeYear: true, changeMonth: true, yearRange: '-80:+10' }); if($(".gdpr_checkbox_list_required").length > 0){ check_required_gdpr(); } $('.js-custom-fields.custom-field-cookie').each(function() { var question_name = $(this).attr('data-question-title') || ''; var question_id = $(this).attr('data-question-id') || ''; var $this = $(this); if (question_id && $('#bm_hidden_field_' + question_id).length > 0 && $('#bm_hidden_field_' + question_id).val().length > 0){ $this.find('[id$=_response]').val($('#bm_hidden_field_' + question_id).val()); } else if (question_name) { $.ajax({ url: "/conferences/change_hidden_field", type: 'GET', dataType: 'json', data: { question_name: question_name, question_id: question_id }, success: function (data) { var cookie_value = data.request_name; if (cookie_value && cookie_value[question_name]) { var value = cookie_value[question_name].join(); $this.find('[id$=_response]').val(value); $this.find('[id$=_response]').attr('id', 'bm_hidden_field_' + question_id); } }, }); } }); }); $(document).on("keyup change keydown", '.js-custom-fields [id^=conference_registration_pre_conference_responses_attributes_][id$=_response]', function(e) { var conditional = $(this).parents('.js-custom-fields').attr('data-conditional') || ''; var data_pass_type = $(this).parents('.js-custom-fields').attr('data-pass-type') || ''; var pass_type = (window.bmCommon || window).atob(decodeURIComponent(data_pass_type)); var use_number = $(this).parents('.js-custom-fields').attr('data-use-number'); if(use_number && use_number == 'true'){ var regex = /^[0-9]+$/; if($(this).val() != '' && !regex.test($(this).val())){ $(this).val(''); return false; } } if($(this).parents('.js-custom-fields').find('.multiple-selection input').length > 0){ var multiple = $(this).parents('.js-custom-fields').find('.multiple-selection input'); var multiple_choice = []; multiple.each(function(index) { multiple_choice.push(multiple[index].value.toLowerCase()); }); } else if ($(this).parents('.js-custom-fields').find('.bmform-section-multiple-select-options span').length > 0){ var multiple = $(this).parents('.js-custom-fields').find('.bmform-section-multiple-select-options span'); var multiple_choice = []; multiple.each(function(index) { multiple_choice.push($(this).find('.bmform-section-multiple-select-options-choice').attr('info').toLowerCase()); }); } else if ($(this).parents('.js-custom-fields').find('.js-multiple-section-check').length > 0) { var multiple = $(this).parents('.js-custom-fields').find('input[id$=_response]').val(); var multiple_choice = []; for (i = 0; i < multiple.split(',').length; i++){ if (multiple.split(',')[i]) { multiple_choice.push(multiple.split(',')[i].toLowerCase()); } } } if (pass_type == '' && $(this).find('option:selected').length > 0){ pass_type = $(this).find('option:selected').text(); } if(conditional != ''){ for (i = 0; i < JSON.parse(conditional).length; i++){ var conditional_sp = JSON.parse(conditional); var pass_type_sp = JSON.parse(pass_type); if(((multiple == undefined && $(this).val() && pass_type_sp[i].split('|').includes($(this).val().toLowerCase())) || pass_type_sp[i].split('|').includes($(this).find('option:selected').text().toLowerCase()) || multiple_choice)){ if(multiple_choice){ $('.' + conditional_sp[i] + '-question').hide(); for (ii = 0; ii < pass_type_sp[i].split('|').length; ii++){ if(multiple_choice.includes(pass_type_sp[i].split('|')[ii])){ $('.' + conditional_sp[i] + '-question').show(); } } }else{ $('.' + conditional_sp[i] + '-question').show(); } }else{ $('.' + conditional_sp[i] + '-question').hide(); } } } }); var password_validate = /^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&*-]).{8,}$/; var password_validate_text = 'Password has to have a minimum length of 8 characters, at least one number, one special character (#, ?, !, @, $, %, ^, &, *, or -), one capital, and one lowercase letter.'; $(document).on("click", "#submit_registration_button", function(e) { if ($('#register_webinar_ids').length > 0 && $('#register_webinar_ids').val() == '') { e.preventDefault(); var warning = $('.js-register-warning-text').text(); if (warning.length > 0) { noty({text: warning, type: 'error', timeout: 5000}); }else{ noty({text: "Please select at least one webinar before registering.", type: 'error', timeout: 5000}); } return false; } var form = $(this).closest('form'); var check = true; if (form.find('.new_member_first_name').length > 0){ if(form.find('.new_member_first_name').val().trim().length == 0) { check = false; form.find('.new_member_first_name').parent().addClass('bmform-error'); }else{ form.find('.new_member_first_name').parent().removeClass('bmform-error'); } } if (form.find('.new_member_last_name').length > 0){ if(form.find('.new_member_last_name').val().trim().length == 0) { check = false; form.find('.new_member_last_name').parent().addClass('bmform-error'); }else{ form.find('.new_member_last_name').parent().removeClass('bmform-error'); } } if (form.find('.new_member_full_name').length > 0){ if(form.find('.new_member_full_name').val().trim().length == 0) { check = false; form.find('.new_member_full_name').parent().addClass('bmform-error'); }else{ form.find('.new_member_full_name').parent().removeClass('bmform-error'); } } if (form.find('.new_member_email').length > 0){ if(form.find('.new_member_email').val().trim().length == 0) { check = false; form.find('.new_member_email').parent().addClass('bmform-error'); }else{ form.find('.new_member_email').parent().removeClass('bmform-error'); } } if (form.find('.new-password').length > 0){ var password_value = form.find('.new-password').val().trim(); if(password_value.length == 0 || !password_validate.test(password_value)) { check = false; form.find('.new-password').parent().addClass('bmform-error'); form.find('.new-password').siblings('.bmform-error-text').html(password_validate_text); }else{ form.find('.new-password').parent().removeClass('bmform-error'); } } if (form.find('.confirm-password').length > 0){ var password_confirm_value = form.find('.confirm-password').val().trim(); if(password_confirm_value.length == 0 || !password_validate.test(password_confirm_value)) { check = false; form.find('.confirm-password').parent().addClass('bmform-error'); form.find('.confirm-password').siblings('.bmform-error-text').html(password_validate_text); }else{ form.find('.confirm-password').parent().removeClass('bmform-error'); } } if (password_value && password_confirm_value && password_value != password_confirm_value) { check = false; form.find('.confirm-password').parent().addClass('bmform-error'); form.find('.confirm-password').siblings('.bmform-error-text').html("Inconsistent password input"); } if ($('.js-privacy-checkbox').length > 0) { if (!$('.js-privacy-checkbox input').prop('checked')) { check = false; $('.js-privacy-checkbox-wrong').addClass('onactive'); } } if (form.find('#registration_child_session_id').length > 0) { if(form.find('#registration_child_session_id').val().trim().length == 0) { check = false; form.find('#registration_child_session_id').parent().parent().addClass('bmform-error'); }else{ form.find('#registration_child_session_id').parent().parent().removeClass('bmform-error'); } } if(window.registrationVerifyCaptcha && !window.registrationVerifyCaptcha(form)) { check = false; } if (form.find('[id^=conference_registration_pre_conference_responses_attributes_][id$=_response]').length > 0) { e.preventDefault(); $.each(form.find('[id^=conference_registration_pre_conference_responses_attributes_][id$=_response]'), function () { if(!$(this).parent().is(":hidden")){ if($(this).hasClass("custom_checkbox_required")){ var not_checked = $(this).siblings().hasClass('js-custom-fields-checkbox-liquid') && !$(this).siblings().prop('checked'); if($(this).val().trim().length == 0 || not_checked){ check = false; $(this).parent().find(".bmform-section-radio-list").addClass('bmform-error'); $(this).parent().find(".bmform-section-checkbox-list").addClass('bmform-error'); $(this).parent().parent().addClass('bmform-error'); $(this).parent().addClass('bmform-error'); }else{ $(this).parent().parent().removeClass('bmform-error'); $(this).parent().removeClass('bmform-error'); $(this).parent().find(".bmform-section-radio-list").removeClass('bmform-error'); $(this).parent().find(".bmform-section-checkbox-list").removeClass('bmform-error'); } } } }); } if (check) { $(this).val("Registering..."); $(this).attr('disabled','disabled') $.ajax({ type: "POST", url: form.attr('action'), data: form.serialize(), success: function(re){ $("#submit_registration_button").val("Register"); $("#submit_registration_button").removeAttr('disabled') } }); }{ return false; } }); function check_gdpr_required(_this) { if (_this.parents('.gdpr_checkbox_list_required').hasClass('onactive')) { return true; } else { if (_this.parents('.js-custom-fields').attr('style') == 'display: none;') { return true; } else { return false; } } } function check_required_gdpr() { var check = true; $('#submit_registration_button').closest('form').find('.gdpr_checkbox_list_required [id$=_response]').each(function() { check = check_gdpr_required($(this)) && check; }); if(check){ if($('#submit_registration_button')) { $('#submit_registration_button').attr("style", "opacity: 1;"); $('#submit_registration_button').removeAttr("disabled"); } }else{ if($('#submit_registration_button')) { $('#submit_registration_button').attr("style", "opacity: 0.5;"); $('#submit_registration_button').attr("disabled", true); } } } $(document).on("click", ".bmform-section-radio-list > .custom_fields_checkbox", function(e) { $(this).parent().parent().find('.bmform-section-radio-list').removeClass('onactive'); $(this).parent().addClass('onactive'); }); $(document).on("click", ".js_gdpr_checkbox", function(e) { if ($(this).parent().hasClass('onactive')) { $(this).parent().removeClass('onactive'); $(this).parent().find('input[id$=_response]').val(false); } else { $(this).parent().addClass('onactive'); $(this).parent().find('input[id$=_response]').val(true); } if($(this).hasClass("gdpr_checkbox_required")){ check_required_gdpr(); } }); $(document).on("click", ".js-custom-fields-checkbox-liquid", function(e) { if ($(this).parent().hasClass('onactive')) { $(this).parent().removeClass('onactive'); $(this).prev().val(false); } else { $(this).parent().addClass('onactive'); $(this).prev().val(true); } }); $(document).on("click", ".js-custom-fields-radio-liquid", function(e) { var choice_val = $(this).attr("info"); $(this).parent().parent().find('input[id$=_response]').val(choice_val).trigger("change");; }); $(document).on("click", ".bmform-section-multiple-select-placeholder", function(e) { e.stopPropagation(); $(".bmform-section-multiple-select").toggleClass('onactive'); }); $(document).on("click", ".bmform-section-multiple-select-options", function(e) { e.stopPropagation(); $(".bmform-section-multiple-select").toggleClass('onactive'); }); $(document).on("click", ".bmform-section-multiple-select-options-choice", function(e) { var response_id = $(this).attr("custom-field-index"); var response_val = $(response_id).val(); var choice_val = $(this).attr("info"); var response_vals_array = response_val.split(','); var index = response_vals_array.indexOf(choice_val); if (index > -1) { response_vals_array.splice(index,1); $(this).parent().parent().remove(); $(response_id).val(response_vals_array.join(",")).trigger('change'); } }); $(window).click(function() { $(".js-bmform-section-multiple-select").removeClass('onactive'); }); $(document).on("click", ".bmform-section-multiple-select-slider-text", function(e) { e.stopPropagation(); var response_id = $(this).attr("custom-field-index"); var response_val = $(response_id).val(); if (response_val === "") { var response_vals_array = [] } else { var response_vals_array = response_val.split(','); } var choice_val = $(this).attr("info"); if (!response_vals_array.includes(choice_val)) { response_vals_array.push(choice_val); html = '' + choice_val + ' '; $(this).parents('.js-custom-fields').find('.bmform-section-multiple-select-options').attr("style", "display: flex;"); $(this).parents('.js-custom-fields').find(".bmform-section-multiple-select-placeholder").attr("style", "display: none;"); $(this).parents('.js-custom-fields').find('.bmform-section-multiple-select-options').append(html); $(response_id).val(response_vals_array.join(",")).trigger('change'); } }); $(document).on("click", ".js-multiple-section-check", function(e) { e.stopPropagation(); var response_val = $(this).parent().parent().find('input[id$=_response]').val(); var response_vals_array = response_val.split(','); if (response_val === "") { var response_vals_array = [] } else { var response_vals_array = response_val.split(','); } var choice_val = $(this).attr("info"); if ($(this).parent().hasClass('onactive')) { var index = response_vals_array.indexOf(choice_val); if (index > -1) { response_vals_array.splice(index,1); $(this).parent().parent().find('input[id$=_response]').val(response_vals_array.join(",")).trigger('change'); $(this).parent().removeClass('onactive'); $(this).val(''); } } else { if (!response_vals_array.includes(choice_val)) { response_vals_array.push(choice_val); $(this).parent().parent().find('input[id$=_response]').val(response_vals_array.join(",")).trigger('change'); $(this).parent().addClass('onactive'); $(this).val(choice_val); } } });
On This Webinar
225+
Delegates