Do not allow user to submit login without a username and a password

This commit is contained in:
Alex Tselegidis 2024-04-08 15:48:53 +02:00
parent babcc774dd
commit f2cdfb871f
2 changed files with 10 additions and 2 deletions

View file

@ -18,14 +18,18 @@
<label for="username" class="form-label">
<?= lang('username') ?>
</label>
<input type="text" id="username" placeholder="<?= lang('enter_username_here') ?>" class="form-control"/>
<input type="text" id="username" placeholder="<?= lang(
'enter_username_here',
) ?>" class="form-control" required/>
</div>
<div class="mb-5">
<label for="password" class="form-label">
<?= lang('password') ?>
</label>
<input type="password" id="password" placeholder="<?= lang('enter_password_here') ?>" class="form-control"/>
<input type="password" id="password" placeholder="<?= lang(
'enter_password_here',
) ?>" class="form-control" required/>
</div>
<div class="d-flex justify-content-between align-items-center mb-5">

View file

@ -32,6 +32,10 @@ App.Pages.Login = (function () {
const username = $username.val();
const password = $password.val();
if (!username || !password) {
return;
}
const $alert = $('.alert');
$alert.addClass('d-none');