mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-11-25 09:23:08 +03:00
Fix install alert msg not showed, pw confirm id + js errors lang
js #retype-password to #password-confirm
This commit is contained in:
parent
ff599e2c00
commit
a04c0cafdf
2 changed files with 10 additions and 10 deletions
|
@ -39,7 +39,7 @@
|
|||
</details></p>
|
||||
</div>
|
||||
|
||||
<div class="alert d-none"></div>
|
||||
<div class="alert" hidden></div>
|
||||
|
||||
<div class="row">
|
||||
<div class="admin-settings col-12 col-sm-5">
|
||||
|
|
|
@ -25,7 +25,7 @@ App.Pages.Installation = (function () {
|
|||
const $phoneNumber = $('#phone-number');
|
||||
const $username = $('#username');
|
||||
const $password = $('#password');
|
||||
const $retypePassword = $('#retype-password');
|
||||
const $passwordConfirm = $('#password-confirm');
|
||||
const $companyName = $('#company-name');
|
||||
const $companyEmail = $('#company-email');
|
||||
const $companyLink = $('#company-link');
|
||||
|
@ -97,31 +97,31 @@ App.Pages.Installation = (function () {
|
|||
});
|
||||
|
||||
if (missingRequired) {
|
||||
throw new Error('All the page fields are required.');
|
||||
throw new Error(lang('fields_are_required'));
|
||||
}
|
||||
|
||||
// Validate Passwords
|
||||
if ($password.val() !== $retypePassword.val()) {
|
||||
if ($password.val() !== $passwordConfirm.val()) {
|
||||
$password.addClass('is-invalid');
|
||||
$retypePassword.addClass('is-invalid');
|
||||
throw new Error('Passwords do not match!');
|
||||
$passwordConfirm.addClass('is-invalid');
|
||||
throw new Error(lang('passwords_mismatch'));
|
||||
}
|
||||
|
||||
if ($password.val().length < MIN_PASSWORD_LENGTH) {
|
||||
$password.addClass('is-invalid');
|
||||
$retypePassword.addClass('is-invalid');
|
||||
throw new Error(`The password must be at least ${MIN_PASSWORD_LENGTH} characters long.`);
|
||||
$passwordConfirm.addClass('is-invalid');
|
||||
throw new Error(lang('password_length_notice').replace('$number', MIN_PASSWORD_LENGTH));
|
||||
}
|
||||
|
||||
// Validate Email
|
||||
if (!App.Utils.Validation.email($email.val())) {
|
||||
$email.addClass('is-invalid');
|
||||
throw new Error('The email address is invalid!');
|
||||
throw new Error(lang('invalid_email'));
|
||||
}
|
||||
|
||||
if (!App.Utils.Validation.email($companyEmail.val())) {
|
||||
$companyEmail.addClass('is-invalid');
|
||||
throw new Error('The email address is invalid!');
|
||||
throw new Error(lang('invalid_email'));
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
Loading…
Reference in a new issue