Validate email address only when it's set
This commit is contained in:
parent
227612565d
commit
ae171b3ffb
1 changed files with 1 additions and 1 deletions
|
@ -626,7 +626,7 @@ App.Components.AppointmentsModal = (function () {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check email address.
|
// Check email address.
|
||||||
if (!App.Utils.Validation.email($appointmentsModal.find('#email').val())) {
|
if ($appointmentsModal.find('#email').val() && !App.Utils.Validation.email($appointmentsModal.find('#email').val())) {
|
||||||
$appointmentsModal.find('#email').addClass('is-invalid');
|
$appointmentsModal.find('#email').addClass('is-invalid');
|
||||||
throw new Error(lang('invalid_email'));
|
throw new Error(lang('invalid_email'));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue