diff --git a/assets/js/backend_admins.js b/assets/js/backend_admins.js index fb1c4100..b553e7f2 100644 --- a/assets/js/backend_admins.js +++ b/assets/js/backend_admins.js @@ -90,12 +90,12 @@ window.BackendAdmins = window.BackendAdmins || {}; $.post(url, data).done(function (response) { if (response.is_valid === 'false') { - $input.closest('.form-group').addClass('has-error'); + $input.addClass('is-invalid'); $input.attr('already-exists', 'true'); $input.parents().eq(3).find('.form-message').text(EALang.username_already_exists); $input.parents().eq(3).find('.form-message').show(); } else { - $input.closest('.form-group').removeClass('has-error'); + $input.removeClass('is-invalid'); $input.attr('already-exists', 'false'); if ($input.parents().eq(3).find('.form-message').text() === EALang.username_already_exists) { $input.parents().eq(3).find('.form-message').hide(); diff --git a/assets/js/backend_admins_helper.js b/assets/js/backend_admins_helper.js index 3651a4d5..284b9896 100644 --- a/assets/js/backend_admins_helper.js +++ b/assets/js/backend_admins_helper.js @@ -276,7 +276,7 @@ * @return {Boolean} Returns the validation result. */ AdminsHelper.prototype.validate = function () { - $('#admins .has-error').removeClass('has-error'); + $('#admins .is-invalid').removeClass('is-invalid'); try { // Validate required fields. @@ -284,7 +284,7 @@ $('#admins .required').each(function (index, requiredField) { if (!$(requiredField).val()) { - $(requiredField).closest('.form-group').addClass('has-error'); + $(requiredField).addClass('is-invalid'); missingRequired = true; } }); @@ -295,7 +295,7 @@ // Validate passwords. if ($('#admin-password').val() !== $('#admin-password-confirm').val()) { - $('#admin-password, #admin-password-confirm').closest('.form-group').addClass('has-error'); + $('#admin-password, #admin-password-confirm').addClass('is-invalid'); throw new Error(EALang.passwords_mismatch); } @@ -303,19 +303,19 @@ $('#admin-password').val().length < BackendAdmins.MIN_PASSWORD_LENGTH && $('#admin-password').val() !== '' ) { - $('#admin-password, #admin-password-confirm').closest('.form-group').addClass('has-error'); + $('#admin-password, #admin-password-confirm').addClass('is-invalid'); throw new Error(EALang.password_length_notice.replace('$number', BackendAdmins.MIN_PASSWORD_LENGTH)); } // Validate user email. if (!GeneralFunctions.validateEmail($('#admin-email').val())) { - $('#admin-email').closest('.form-group').addClass('has-error'); + $('#admin-email').addClass('is-invalid'); throw new Error(EALang.invalid_email); } // Check if username exists if ($('#admin-username').attr('already-exists') === 'true') { - $('#admin-username').closest('.form-group').addClass('has-error'); + $('#admin-username').addClass('is-invalid'); throw new Error(EALang.username_already_exists); } @@ -341,7 +341,7 @@ $('#admins .record-details #admin-timezone').val('UTC'); $('#edit-admin, #delete-admin').prop('disabled', true); - $('#admins .has-error').removeClass('has-error'); + $('#admins .is-invalid').removeClass('is-invalid'); $('#admins .form-message').hide(); }; diff --git a/assets/js/backend_calendar_appointments_modal.js b/assets/js/backend_calendar_appointments_modal.js index 3d899c90..40d8f7c3 100755 --- a/assets/js/backend_calendar_appointments_modal.js +++ b/assets/js/backend_calendar_appointments_modal.js @@ -578,7 +578,7 @@ window.BackendCalendarAppointmentsModal = window.BackendCalendarAppointmentsModa var $dialog = $('#manage-appointment'); // Reset previous validation css formatting. - $dialog.find('.has-error').removeClass('has-error'); + $dialog.find('.is-invalid').removeClass('is-invalid'); $dialog.find('.modal-message').addClass('d-none'); try { @@ -587,7 +587,7 @@ window.BackendCalendarAppointmentsModal = window.BackendCalendarAppointmentsModa $dialog.find('.required').each(function (index, requiredField) { if ($(requiredField).val() === '' || $(requiredField).val() === null) { - $(requiredField).closest('.form-group').addClass('has-error'); + $(requiredField).addClass('is-invalid'); missingRequiredField = true; } }); @@ -598,7 +598,7 @@ window.BackendCalendarAppointmentsModal = window.BackendCalendarAppointmentsModa // Check email address. if (!GeneralFunctions.validateEmail($dialog.find('#email').val())) { - $dialog.find('#email').closest('.form-group').addClass('has-error'); + $dialog.find('#email').addClass('is-invalid'); throw new Error(EALang.invalid_email); } @@ -606,7 +606,7 @@ window.BackendCalendarAppointmentsModal = window.BackendCalendarAppointmentsModa var start = $('#start-datetime').datetimepicker('getDate'); var end = $('#end-datetime').datetimepicker('getDate'); if (start > end) { - $dialog.find('#start-datetime, #end-datetime').closest('.form-group').addClass('has-error'); + $dialog.find('#start-datetime, #end-datetime').addClass('is-invalid'); throw new Error(EALang.start_date_before_end_error); } diff --git a/assets/js/backend_calendar_unavailability_events_modal.js b/assets/js/backend_calendar_unavailability_events_modal.js index 90607992..d56f72d4 100755 --- a/assets/js/backend_calendar_unavailability_events_modal.js +++ b/assets/js/backend_calendar_unavailability_events_modal.js @@ -30,19 +30,19 @@ window.BackendCalendarUnavailabilityEventsModal = window.BackendCalendarUnavaila $('#manage-unavailable #save-unavailable').on('click', function () { var $dialog = $('#manage-unavailable'); $dialog.find('.modal-message').addClass('d-none'); - $dialog.find('.has-error').removeClass('has-error'); + $dialog.find('.is-invalid').removeClass('is-invalid'); var start = $dialog.find('#unavailable-start').datetimepicker('getDate'); if (!start) { - $dialog.find('#unavailable-start').closest('.form-group').addClass('has-error'); + $dialog.find('#unavailable-start').addClass('is-invalid'); return; } var end = Date.parse($dialog.find('#unavailable-end').datetimepicker('getDate')); if (!end) { - $dialog.find('#unavailable-end').closest('.form-group').addClass('has-error'); + $dialog.find('#unavailable-end').addClass('is-invalid'); return; } @@ -54,7 +54,7 @@ window.BackendCalendarUnavailabilityEventsModal = window.BackendCalendarUnavaila .addClass('alert-danger') .removeClass('d-none'); - $dialog.find('#unavailable-start, #unavailable-end').closest('.form-group').addClass('has-error'); + $dialog.find('#unavailable-start, #unavailable-end').addClass('is-invalid'); return; } diff --git a/assets/js/backend_calendar_working_plan_exceptions_modal.js b/assets/js/backend_calendar_working_plan_exceptions_modal.js index 233737be..f54f67bb 100644 --- a/assets/js/backend_calendar_working_plan_exceptions_modal.js +++ b/assets/js/backend_calendar_working_plan_exceptions_modal.js @@ -30,26 +30,26 @@ window.BackendCalendarWorkingPlanExceptionsModal = window.BackendCalendarWorking $('#manage-working-plan-exceptions #save-working-plan-exception').on('click', function () { $('#manage-working-plan-exceptions .modal-message').prop('hidden', true); - $('#manage-working-plan-exceptions').find('.has-error').removeClass('has-error'); + $('#manage-working-plan-exceptions').find('.is-invalid').removeClass('is-invalid'); var date = $('#working-plan-exception-date').datetimepicker('getDate'); if (!date) { - $('#working-plan-exception-date').closest('.form-group').addClass('has-error'); + $('#working-plan-exception-date').addClass('is-invalid'); return; } var start = $('#working-plan-exception-start').datetimepicker('getDate'); if (!start) { - $('#working-plan-exception-start').closest('.form-group').addClass('has-error'); + $('#working-plan-exception-start').addClass('is-invalid'); return; } var end = Date.parse($('#working-plan-exception-end').datetimepicker('getDate')); if (!end) { - $('#working-plan-exception-end').closest('.form-group').addClass('has-error'); + $('#working-plan-exception-end').addClass('is-invalid'); return; } @@ -60,8 +60,8 @@ window.BackendCalendarWorkingPlanExceptionsModal = window.BackendCalendarWorking .addClass('alert-danger') .prop('hidden', false); - $('#working-plan-exception-start').addClass('has-error'); - $('#working-plan-exception-end').addClass('has-error'); + $('#working-plan-exception-start').addClass('is-invalid'); + $('#working-plan-exception-end').addClass('is-invalid'); return; } diff --git a/assets/js/backend_categories_helper.js b/assets/js/backend_categories_helper.js index b9ce9be9..727c5d88 100644 --- a/assets/js/backend_categories_helper.js +++ b/assets/js/backend_categories_helper.js @@ -288,7 +288,7 @@ * @return {Boolean} Returns the validation result. */ CategoriesHelper.prototype.validate = function () { - $('#categories .has-error').removeClass('has-error'); + $('#categories .is-invalid').removeClass('is-invalid'); $('#categories .form-message').removeClass('alert-danger').hide(); try { @@ -296,7 +296,7 @@ $('#categories .required').each(function (index, requiredField) { if (!$(requiredField).val()) { - $(requiredField).closest('.form-group').addClass('has-error'); + $(requiredField).addClass('is-invalid'); missingRequired = true; } }); @@ -325,7 +325,7 @@ $('#categories .record-details').find('input, select, textarea').val('').prop('disabled', true); $('#edit-category, #delete-category').prop('disabled', true); - $('#categories .record-details .has-error').removeClass('has-error'); + $('#categories .record-details .is-invalid').removeClass('is-invalid'); $('#categories .record-details .form-message').hide(); }; diff --git a/assets/js/backend_customers_helper.js b/assets/js/backend_customers_helper.js index 92235489..aa98dd71 100644 --- a/assets/js/backend_customers_helper.js +++ b/assets/js/backend_customers_helper.js @@ -212,7 +212,7 @@ */ CustomersHelper.prototype.validate = function () { $('#form-message').removeClass('alert-danger').hide(); - $('.has-error').removeClass('has-error'); + $('.is-invalid').removeClass('is-invalid'); try { // Validate required fields. @@ -220,7 +220,7 @@ $('.required').each(function (index, requiredField) { if ($(requiredField).val() === '') { - $(requiredField).closest('.form-group').addClass('has-error'); + $(requiredField).addClass('is-invalid'); missingRequired = true; } }); @@ -231,7 +231,7 @@ // Validate email address. if (!GeneralFunctions.validateEmail($('#email').val())) { - $('#email').closest('.form-group').addClass('has-error'); + $('#email').addClass('is-invalid'); throw new Error(EALang.invalid_email); } @@ -256,7 +256,7 @@ $('#add-edit-delete-group').show(); $('#save-cancel-group').hide(); - $('.record-details .has-error').removeClass('has-error'); + $('.record-details .is-invalid').removeClass('is-invalid'); $('.record-details #form-message').hide(); $('#filter-customers button').prop('disabled', false); diff --git a/assets/js/backend_providers.js b/assets/js/backend_providers.js index 53b3e135..111a9b7e 100644 --- a/assets/js/backend_providers.js +++ b/assets/js/backend_providers.js @@ -126,12 +126,12 @@ window.BackendProviders = window.BackendProviders || {}; $.post(url, data).done(function (response) { if (response.is_valid === 'false') { - $input.closest('.form-group').addClass('has-error'); + $input.addClass('is-invalid'); $input.attr('already-exists', 'true'); $input.parents().eq(3).find('.form-message').text(EALang.username_already_exists); $input.parents().eq(3).find('.form-message').show(); } else { - $input.closest('.form-group').removeClass('has-error'); + $input.removeClass('is-invalid'); $input.attr('already-exists', 'false'); if ($input.parents().eq(3).find('.form-message').text() === EALang.username_already_exists) { $input.parents().eq(3).find('.form-message').hide(); diff --git a/assets/js/backend_providers_helper.js b/assets/js/backend_providers_helper.js index ecbf7569..591b5525 100755 --- a/assets/js/backend_providers_helper.js +++ b/assets/js/backend_providers_helper.js @@ -322,7 +322,7 @@ * @return {Boolean} Returns the validation result. */ ProvidersHelper.prototype.validate = function () { - $('#providers .has-error').removeClass('has-error'); + $('#providers .is-invalid').removeClass('is-invalid'); $('#providers .form-message').removeClass('alert-danger').hide(); try { @@ -330,7 +330,7 @@ var missingRequired = false; $('#providers .required').each(function (index, requiredField) { if (!$(requiredField).val()) { - $(requiredField).closest('.form-group').addClass('has-error'); + $(requiredField).addClass('is-invalid'); missingRequired = true; } }); @@ -340,7 +340,7 @@ // Validate passwords. if ($('#provider-password').val() !== $('#provider-password-confirm').val()) { - $('#provider-password, #provider-password-confirm').closest('.form-group').addClass('has-error'); + $('#provider-password, #provider-password-confirm').addClass('is-invalid'); throw new Error(EALang.passwords_mismatch); } @@ -348,19 +348,19 @@ $('#provider-password').val().length < BackendProviders.MIN_PASSWORD_LENGTH && $('#provider-password').val() !== '' ) { - $('#provider-password, #provider-password-confirm').closest('.form-group').addClass('has-error'); + $('#provider-password, #provider-password-confirm').addClass('is-invalid'); throw new Error(EALang.password_length_notice.replace('$number', BackendProviders.MIN_PASSWORD_LENGTH)); } // Validate user email. if (!GeneralFunctions.validateEmail($('#provider-email').val())) { - $('#provider-email').closest('.form-group').addClass('has-error'); + $('#provider-email').addClass('is-invalid'); throw new Error(EALang.invalid_email); } // Check if username exists if ($('#provider-username').attr('already-exists') === 'true') { - $('#provider-username').closest('.form-group').addClass('has-error'); + $('#provider-username').addClass('is-invalid'); throw new Error(EALang.username_already_exists); } @@ -394,7 +394,7 @@ .find('.edit-working-plan-exception, .delete-working-plan-exception') .prop('disabled', true); - $('#providers .record-details .has-error').removeClass('has-error'); + $('#providers .record-details .is-invalid').removeClass('is-invalid'); $('#providers .record-details .form-message').hide(); $('#edit-provider, #delete-provider').prop('disabled', true); diff --git a/assets/js/backend_secretaries.js b/assets/js/backend_secretaries.js index 59d4640b..17bd9eeb 100644 --- a/assets/js/backend_secretaries.js +++ b/assets/js/backend_secretaries.js @@ -113,12 +113,12 @@ window.BackendSecretaries = window.BackendSecretaries || {}; $.post(url, data).done(function (response) { if (response.is_valid === 'false') { - $input.closest('.form-group').addClass('has-error'); + $input.addClass('is-invalid'); $input.attr('already-exists', 'true'); $input.parents().eq(3).find('.form-message').text(EALang.username_already_exists); $input.parents().eq(3).find('.form-message').show(); } else { - $input.closest('.form-group').removeClass('has-error'); + $input.removeClass('is-invalid'); $input.attr('already-exists', 'false'); if ($input.parents().eq(3).find('.form-message').text() === EALang.username_already_exists) { $input.parents().eq(3).find('.form-message').hide(); diff --git a/assets/js/backend_secretaries_helper.js b/assets/js/backend_secretaries_helper.js index 8a221387..557c8030 100644 --- a/assets/js/backend_secretaries_helper.js +++ b/assets/js/backend_secretaries_helper.js @@ -289,7 +289,7 @@ * @return {Boolean} Returns the validation result. */ SecretariesHelper.prototype.validate = function () { - $('#secretaries .has-error').removeClass('has-error'); + $('#secretaries .is-invalid').removeClass('is-invalid'); $('#secretaries .form-message').removeClass('alert-danger'); try { @@ -297,7 +297,7 @@ var missingRequired = false; $('#secretaries .required').each(function (index, requiredField) { if (!$(requiredField).val()) { - $(requiredField).closest('.form-group').addClass('has-error'); + $(requiredField).addClass('is-invalid'); missingRequired = true; } }); @@ -307,7 +307,7 @@ // Validate passwords. if ($('#secretary-password').val() !== $('#secretary-password-confirm').val()) { - $('#secretary-password, #secretary-password-confirm').closest('.form-group').addClass('has-error'); + $('#secretary-password, #secretary-password-confirm').addClass('is-invalid'); throw new Error('Passwords mismatch!'); } @@ -315,19 +315,19 @@ $('#secretary-password').val().length < BackendSecretaries.MIN_PASSWORD_LENGTH && $('#secretary-password').val() !== '' ) { - $('#secretary-password, #secretary-password-confirm').closest('.form-group').addClass('has-error'); + $('#secretary-password, #secretary-password-confirm').addClass('is-invalid'); throw new Error('Password must be at least ' + BackendSecretaries.MIN_PASSWORD_LENGTH + ' characters long.'); } // Validate user email. if (!GeneralFunctions.validateEmail($('#secretary-email').val())) { - $('#secretary-email').closest('.form-group').addClass('has-error'); + $('#secretary-email').addClass('is-invalid'); throw new Error('Invalid email address!'); } // Check if username exists if ($('#secretary-username').attr('already-exists') === 'true') { - $('#secretary-username').closest('.form-group').addClass('has-error'); + $('#secretary-username').addClass('is-invalid'); throw new Error('Username already exists.'); } @@ -354,7 +354,7 @@ $('#edit-secretary, #delete-secretary').prop('disabled', true); $('#secretaries .form-message').hide(); $('#secretary-providers input:checkbox').prop('checked', false); - $('#secretaries .has-error').removeClass('has-error'); + $('#secretaries .is-invalid').removeClass('is-invalid'); }; /** diff --git a/assets/js/backend_services_helper.js b/assets/js/backend_services_helper.js index 11f00521..289c0dc2 100644 --- a/assets/js/backend_services_helper.js +++ b/assets/js/backend_services_helper.js @@ -255,7 +255,7 @@ * @return {Boolean} Returns the validation result. */ ServicesHelper.prototype.validate = function () { - $('#services .has-error').removeClass('has-error'); + $('#services .is-invalid').removeClass('is-invalid'); $('#services .form-message').removeClass('alert-danger').hide(); try { @@ -264,7 +264,7 @@ $('#services .required').each(function (index, requiredField) { if (!$(requiredField).val()) { - $(requiredField).closest('.form-group').addClass('has-error'); + $(requiredField).addClass('is-invalid'); missingRequired = true; } }); @@ -275,7 +275,7 @@ // Validate the duration. if (Number($('#service-duration').val()) < 5) { - $('#service-duration').closest('.form-group').addClass('has-error'); + $('#service-duration').addClass('is-invalid'); throw new Error(EALang.invalid_duration); } @@ -301,7 +301,7 @@ $('#services .save-cancel-group').hide(); $('#edit-service, #delete-service').prop('disabled', true); - $('#services .record-details .has-error').removeClass('has-error'); + $('#services .record-details .is-invalid').removeClass('is-invalid'); $('#services .record-details .form-message').hide(); }; diff --git a/assets/js/backend_settings_business_logic_helper.js b/assets/js/backend_settings_business_logic_helper.js index 5cf47377..1f234398 100644 --- a/assets/js/backend_settings_business_logic_helper.js +++ b/assets/js/backend_settings_business_logic_helper.js @@ -96,14 +96,14 @@ * @return {Boolean} Returns the validation result. */ SystemSettingsBusinessLogicHelper.prototype.validate = function () { - $('#business-logic .has-error').removeClass('has-error'); + $('#business-logic .is-invalid').removeClass('is-invalid'); try { // Validate required fields. var missingRequired = false; $('#business-logic .required').each(function (index, requiredField) { if (!$(requiredField).val()) { - $(requiredField).closest('.form-group').addClass('has-error'); + $(requiredField).addClass('is-invalid'); missingRequired = true; } }); diff --git a/assets/js/backend_settings_client_form_helper.js b/assets/js/backend_settings_client_form_helper.js index b07a9e24..27bdfc87 100644 --- a/assets/js/backend_settings_client_form_helper.js +++ b/assets/js/backend_settings_client_form_helper.js @@ -135,14 +135,14 @@ * @return {Boolean} Returns the validation result. */ SystemSettingsClientFormHelper.prototype.validate = function () { - $('#client-form .has-error').removeClass('has-error'); + $('#client-form .is-invalid').removeClass('is-invalid'); try { // Validate required fields. var missingRequired = false; $('#client-form .required').each(function (index, requiredField) { if (!$(requiredField).val()) { - $(requiredField).closest('.form-group').addClass('has-error'); + $(requiredField).addClass('is-invalid'); missingRequired = true; } }); diff --git a/assets/js/backend_settings_current_user_helper.js b/assets/js/backend_settings_current_user_helper.js index 7a73f729..2fb9b6fb 100644 --- a/assets/js/backend_settings_current_user_helper.js +++ b/assets/js/backend_settings_current_user_helper.js @@ -87,14 +87,14 @@ * @return {Boolean} Returns the validation result. */ SystemSettingsCurrentUserHelper.prototype.validate = function () { - $('#current-user .has-error').removeClass('has-error'); + $('#current-user .is-invalid').removeClass('is-invalid'); try { // Validate required fields. var missingRequired = false; $('#current-user .required').each(function (index, requiredField) { if (!$(requiredField).val()) { - $(requiredField).closest('.form-group').addClass('has-error'); + $(requiredField).addClass('is-invalid'); missingRequired = true; } }); @@ -105,18 +105,18 @@ // Validate passwords (if provided). if ($('#password').val() !== $('#retype-password').val()) { - $('#password, #retype-password').closest('.form-group').addClass('has-error'); + $('#password, #retype-password').addClass('is-invalid'); throw new Error(EALang.passwords_mismatch); } // Validate user email. if (!GeneralFunctions.validateEmail($('#email').val())) { - $('#email').closest('.form-group').addClass('has-error'); + $('#email').addClass('is-invalid'); throw new Error(EALang.invalid_email); } if ($('#username').attr('already-exists') === 'true') { - $('#username').closest('.form-group').addClass('has-error'); + $('#username').addClass('is-invalid'); throw new Error(EALang.username_already_exists); } diff --git a/assets/js/backend_settings_general_helper.js b/assets/js/backend_settings_general_helper.js index f65d4718..cd5611e9 100644 --- a/assets/js/backend_settings_general_helper.js +++ b/assets/js/backend_settings_general_helper.js @@ -95,14 +95,14 @@ * @return {Boolean} Returns the validation result. */ SystemSettingsGeneralHelper.prototype.validate = function () { - $('#general .has-error').removeClass('has-error'); + $('#general .is-invalid').removeClass('is-invalid'); try { // Validate required fields. var missingRequired = false; $('#general .required').each(function (index, requiredField) { if (!$(requiredField).val()) { - $(requiredField).closest('.form-group').addClass('has-error'); + $(requiredField).addClass('is-invalid'); missingRequired = true; } }); @@ -113,7 +113,7 @@ // Validate company email address. if (!GeneralFunctions.validateEmail($('#company-email').val())) { - $('#company-email').closest('.form-group').addClass('has-error'); + $('#company-email').addClass('is-invalid'); throw new Error(EALang.invalid_email); } diff --git a/assets/js/backend_settings_legal_contents_helper.js b/assets/js/backend_settings_legal_contents_helper.js index 1aba6c5f..644567e3 100644 --- a/assets/js/backend_settings_legal_contents_helper.js +++ b/assets/js/backend_settings_legal_contents_helper.js @@ -97,14 +97,14 @@ * @return {Boolean} Returns the validation result. */ SystemSettingsLegalContentsHelper.prototype.validate = function () { - $('#legal-contents .has-error').removeClass('has-error'); + $('#legal-contents .is-invalid').removeClass('is-invalid'); try { // Validate required fields. var missingRequired = false; $('#general .required').each(function (index, requiredField) { if (!$(requiredField).val()) { - $(requiredField).closest('.form-group').addClass('has-error'); + $(requiredField).addClass('is-invalid'); missingRequired = true; } }); diff --git a/assets/js/backend_users.js b/assets/js/backend_users.js index 7a7811fd..f32c01cf 100644 --- a/assets/js/backend_users.js +++ b/assets/js/backend_users.js @@ -219,12 +219,12 @@ window.BackendUsers = window.BackendUsers || {}; $.post(url, data).done(function (response) { if (response.is_valid === 'false') { - $input.closest('.form-group').addClass('has-error'); + $input.addClass('is-invalid'); $input.attr('already-exists', 'true'); $input.parents().eq(3).find('.form-message').text(EALang.username_already_exists); $input.parents().eq(3).find('.form-message').show(); } else { - $input.closest('.form-group').removeClass('has-error'); + $input.removeClass('is-invalid'); $input.attr('already-exists', 'false'); if ($input.parents().eq(3).find('.form-message').text() === EALang.username_already_exists) { $input.parents().eq(3).find('.form-message').hide(); diff --git a/assets/js/backend_users_admins.js b/assets/js/backend_users_admins.js index 94983a10..56a43e77 100644 --- a/assets/js/backend_users_admins.js +++ b/assets/js/backend_users_admins.js @@ -276,7 +276,7 @@ * @return {Boolean} Returns the validation result. */ AdminsHelper.prototype.validate = function () { - $('#admins .has-error').removeClass('has-error'); + $('#admins .is-invalid').removeClass('is-invalid'); try { // Validate required fields. @@ -284,7 +284,7 @@ $('#admins .required').each(function (index, requiredField) { if (!$(requiredField).val()) { - $(requiredField).closest('.form-group').addClass('has-error'); + $(requiredField).addClass('is-invalid'); missingRequired = true; } }); @@ -295,7 +295,7 @@ // Validate passwords. if ($('#admin-password').val() !== $('#admin-password-confirm').val()) { - $('#admin-password, #admin-password-confirm').closest('.form-group').addClass('has-error'); + $('#admin-password, #admin-password-confirm').addClass('is-invalid'); throw new Error(EALang.passwords_mismatch); } @@ -303,19 +303,19 @@ $('#admin-password').val().length < BackendUsers.MIN_PASSWORD_LENGTH && $('#admin-password').val() !== '' ) { - $('#admin-password, #admin-password-confirm').closest('.form-group').addClass('has-error'); + $('#admin-password, #admin-password-confirm').addClass('is-invalid'); throw new Error(EALang.password_length_notice.replace('$number', BackendUsers.MIN_PASSWORD_LENGTH)); } // Validate user email. if (!GeneralFunctions.validateEmail($('#admin-email').val())) { - $('#admin-email').closest('.form-group').addClass('has-error'); + $('#admin-email').addClass('is-invalid'); throw new Error(EALang.invalid_email); } // Check if username exists if ($('#admin-username').attr('already-exists') === 'true') { - $('#admin-username').closest('.form-group').addClass('has-error'); + $('#admin-username').addClass('is-invalid'); throw new Error(EALang.username_already_exists); } @@ -341,7 +341,7 @@ $('#admins .record-details #admin-timezone').val('UTC'); $('#edit-admin, #delete-admin').prop('disabled', true); - $('#admins .has-error').removeClass('has-error'); + $('#admins .is-invalid').removeClass('is-invalid'); $('#admins .form-message').hide(); }; diff --git a/assets/js/backend_users_providers.js b/assets/js/backend_users_providers.js index 19171804..9681fe9a 100755 --- a/assets/js/backend_users_providers.js +++ b/assets/js/backend_users_providers.js @@ -321,7 +321,7 @@ * @return {Boolean} Returns the validation result. */ ProvidersHelper.prototype.validate = function () { - $('#providers .has-error').removeClass('has-error'); + $('#providers .is-invalid').removeClass('is-invalid'); $('#providers .form-message').removeClass('alert-danger').hide(); try { @@ -329,7 +329,7 @@ var missingRequired = false; $('#providers .required').each(function (index, requiredField) { if (!$(requiredField).val()) { - $(requiredField).closest('.form-group').addClass('has-error'); + $(requiredField).addClass('is-invalid'); missingRequired = true; } }); @@ -339,7 +339,7 @@ // Validate passwords. if ($('#provider-password').val() !== $('#provider-password-confirm').val()) { - $('#provider-password, #provider-password-confirm').closest('.form-group').addClass('has-error'); + $('#provider-password, #provider-password-confirm').addClass('is-invalid'); throw new Error(EALang.passwords_mismatch); } @@ -347,19 +347,19 @@ $('#provider-password').val().length < BackendUsers.MIN_PASSWORD_LENGTH && $('#provider-password').val() !== '' ) { - $('#provider-password, #provider-password-confirm').closest('.form-group').addClass('has-error'); + $('#provider-password, #provider-password-confirm').addClass('is-invalid'); throw new Error(EALang.password_length_notice.replace('$number', BackendUsers.MIN_PASSWORD_LENGTH)); } // Validate user email. if (!GeneralFunctions.validateEmail($('#provider-email').val())) { - $('#provider-email').closest('.form-group').addClass('has-error'); + $('#provider-email').addClass('is-invalid'); throw new Error(EALang.invalid_email); } // Check if username exists if ($('#provider-username').attr('already-exists') === 'true') { - $('#provider-username').closest('.form-group').addClass('has-error'); + $('#provider-username').addClass('is-invalid'); throw new Error(EALang.username_already_exists); } @@ -393,7 +393,7 @@ .find('.edit-working-plan-exception, .delete-working-plan-exception') .prop('disabled', true); - $('#providers .record-details .has-error').removeClass('has-error'); + $('#providers .record-details .is-invalid').removeClass('is-invalid'); $('#providers .record-details .form-message').hide(); $('#edit-provider, #delete-provider').prop('disabled', true); diff --git a/assets/js/backend_users_secretaries.js b/assets/js/backend_users_secretaries.js index 5c7b69e6..0122b614 100644 --- a/assets/js/backend_users_secretaries.js +++ b/assets/js/backend_users_secretaries.js @@ -289,7 +289,7 @@ * @return {Boolean} Returns the validation result. */ SecretariesHelper.prototype.validate = function () { - $('#secretaries .has-error').removeClass('has-error'); + $('#secretaries .is-invalid').removeClass('is-invalid'); $('#secretaries .form-message').removeClass('alert-danger'); try { @@ -297,7 +297,7 @@ var missingRequired = false; $('#secretaries .required').each(function (index, requiredField) { if (!$(requiredField).val()) { - $(requiredField).closest('.form-group').addClass('has-error'); + $(requiredField).addClass('is-invalid'); missingRequired = true; } }); @@ -307,7 +307,7 @@ // Validate passwords. if ($('#secretary-password').val() !== $('#secretary-password-confirm').val()) { - $('#secretary-password, #secretary-password-confirm').closest('.form-group').addClass('has-error'); + $('#secretary-password, #secretary-password-confirm').addClass('is-invalid'); throw new Error('Passwords mismatch!'); } @@ -315,19 +315,19 @@ $('#secretary-password').val().length < BackendUsers.MIN_PASSWORD_LENGTH && $('#secretary-password').val() !== '' ) { - $('#secretary-password, #secretary-password-confirm').closest('.form-group').addClass('has-error'); + $('#secretary-password, #secretary-password-confirm').addClass('is-invalid'); throw new Error('Password must be at least ' + BackendUsers.MIN_PASSWORD_LENGTH + ' characters long.'); } // Validate user email. if (!GeneralFunctions.validateEmail($('#secretary-email').val())) { - $('#secretary-email').closest('.form-group').addClass('has-error'); + $('#secretary-email').addClass('is-invalid'); throw new Error('Invalid email address!'); } // Check if username exists if ($('#secretary-username').attr('already-exists') === 'true') { - $('#secretary-username').closest('.form-group').addClass('has-error'); + $('#secretary-username').addClass('is-invalid'); throw new Error('Username already exists.'); } @@ -354,7 +354,7 @@ $('#edit-secretary, #delete-secretary').prop('disabled', true); $('#secretaries .form-message').hide(); $('#secretary-providers input:checkbox').prop('checked', false); - $('#secretaries .has-error').removeClass('has-error'); + $('#secretaries .is-invalid').removeClass('is-invalid'); }; /** diff --git a/assets/js/frontend_book.js b/assets/js/frontend_book.js index f7321652..986acd07 100644 --- a/assets/js/frontend_book.js +++ b/assets/js/frontend_book.js @@ -501,7 +501,7 @@ window.FrontendBook = window.FrontendBook || {}; * @return {Boolean} Returns the validation result. */ function validateCustomerForm() { - $('#wizard-frame-3 .has-error').removeClass('has-error'); + $('#wizard-frame-3 .is-invalid').removeClass('is-invalid'); $('#wizard-frame-3 label.text-danger').removeClass('text-danger'); try { @@ -509,7 +509,7 @@ window.FrontendBook = window.FrontendBook || {}; var missingRequiredField = false; $('.required').each(function (index, requiredField) { if (!$(requiredField).val()) { - $(requiredField).parents('.form-group').addClass('has-error'); + $(requiredField).parents('.form-group').addClass('is-invalid'); missingRequiredField = true; } }); @@ -531,7 +531,7 @@ window.FrontendBook = window.FrontendBook || {}; // Validate email address. if (!GeneralFunctions.validateEmail($('#email').val())) { - $('#email').parents('.form-group').addClass('has-error'); + $('#email').parents('.form-group').addClass('is-invalid'); throw new Error(EALang.invalid_email); } diff --git a/assets/js/frontend_book_api.js b/assets/js/frontend_book_api.js index d02202ba..7e5ce907 100755 --- a/assets/js/frontend_book_api.js +++ b/assets/js/frontend_book_api.js @@ -151,9 +151,9 @@ window.FrontendBookApi = window.FrontendBookApi || {}; var $captchaText = $('.captcha-text'); if ($captchaText.length > 0) { - $captchaText.closest('.form-group').removeClass('has-error'); + $captchaText.removeClass('is-invalid'); if ($captchaText.val() === '') { - $captchaText.closest('.form-group').addClass('has-error'); + $captchaText.addClass('is-invalid'); return; } } @@ -204,7 +204,7 @@ window.FrontendBookApi = window.FrontendBookApi || {}; $('.captcha-title button').trigger('click'); - $captchaText.closest('.form-group').addClass('has-error'); + $captchaText.addClass('is-invalid'); return false; } diff --git a/assets/js/installation.js b/assets/js/installation.js index 2dfb0a5d..1bae05f0 100644 --- a/assets/js/installation.js +++ b/assets/js/installation.js @@ -68,13 +68,13 @@ $(function () { function validate() { try { $alert.removeClass('alert-danger').prop('hidden', true); - $('input').closest('.form-group').removeClass('has-error'); + $('input').removeClass('is-invalid'); // Check for empty fields. var missingRequired = false; $('input').each(function (index, field) { if (!$(field).val()) { - $(field).closest('.form-group').addClass('has-error'); + $(field).addClass('is-invalid'); missingRequired = true; } }); @@ -85,25 +85,25 @@ $(function () { // Validate Passwords if ($('#password').val() !== $('#retype-password').val()) { - $('#password').closest('.form-group').addClass('has-error'); - $('#retype-password').closest('.form-group').addClass('has-error'); + $('#password').addClass('is-invalid'); + $('#retype-password').addClass('is-invalid'); throw new Error('Passwords do not match!'); } if ($('#password').val().length < MIN_PASSWORD_LENGTH) { - $('#password').closest('.form-group').addClass('has-error'); - $('#retype-password').closest('.form-group').addClass('has-error'); + $('#password').addClass('is-invalid'); + $('#retype-password').addClass('is-invalid'); throw new Error('The password must be at least ' + MIN_PASSWORD_LENGTH + ' characters long.'); } // Validate Email if (!GeneralFunctions.validateEmail($('#email').val())) { - $('#email').closest('.form-group').addClass('has-error'); + $('#email').addClass('is-invalid'); throw new Error('The email address is invalid!'); } if (!GeneralFunctions.validateEmail($('#company-email').val())) { - $('#company-email').closest('.form-group').addClass('has-error'); + $('#company-email').addClass('is-invalid'); throw new Error('The email address is invalid!'); }