Added required fields message in all forms.

This commit is contained in:
Alex Tselegidis 2020-09-07 14:40:59 +03:00
parent 69e39b9062
commit 4a7d6e5d6e
5 changed files with 87 additions and 53 deletions

View file

@ -303,10 +303,15 @@
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="phone-number" class="control-label"><?= lang('phone_number') ?> <label for="phone-number" class="control-label">
*</label> <?= lang('phone_number') ?> *
</label>
<input id="phone-number" class="required form-control"> <input id="phone-number" class="required form-control">
</div> </div>
<p class="text-danger">
<small><?= lang('fields_are_required') ?></small>
</p>
</div> </div>
<div class="col-12 col-sm-6"> <div class="col-12 col-sm-6">
<div class="form-group"> <div class="form-group">

View file

@ -142,8 +142,8 @@
<textarea id="notes" rows="4" class="form-control"></textarea> <textarea id="notes" rows="4" class="form-control"></textarea>
</div> </div>
<p class="text-center"> <p class="text-danger">
<em id="form-message" class="text-danger"><?= lang('fields_are_required') ?></em> <small><?= lang('fields_are_required') ?></small>
</p> </p>
</div> </div>

View file

@ -153,8 +153,8 @@
<textarea id="service-description" rows="4" class="form-control"></textarea> <textarea id="service-description" rows="4" class="form-control"></textarea>
</div> </div>
<p id="form-message" class="text-danger"> <p class="text-danger">
<em><?= lang('fields_are_required') ?></em> <small><?= lang('fields_are_required') ?></small>
</p> </p>
</div> </div>
</div> </div>
@ -230,6 +230,10 @@
<label for="category-description"><?= lang('description') ?></label> <label for="category-description"><?= lang('description') ?></label>
<textarea id="category-description" rows="4" class="form-control"></textarea> <textarea id="category-description" rows="4" class="form-control"></textarea>
</div> </div>
<p class="text-danger">
<small><?= lang('fields_are_required') ?></small>
</p>
</div> </div>
</div> </div>
</div> </div>

View file

@ -26,7 +26,7 @@
} }
}; };
$(function() { $(function () {
BackendSettings.initialize(true); BackendSettings.initialize(true);
}); });
</script> </script>
@ -144,6 +144,10 @@
<?= lang('first_weekday_hint') ?> <?= lang('first_weekday_hint') ?>
</span> </span>
</div> </div>
<p class="text-danger">
<small><?= lang('fields_are_required') ?></small>
</p>
</div> </div>
<div class="col-12 col-sm-6"> <div class="col-12 col-sm-6">
<div class="form-group"> <div class="form-group">
@ -239,11 +243,11 @@
<table class="working-plan table table-striped"> <table class="working-plan table table-striped">
<thead> <thead>
<tr> <tr>
<th><?= lang('day') ?></th> <th><?= lang('day') ?></th>
<th><?= lang('start') ?></th> <th><?= lang('start') ?></th>
<th><?= lang('end') ?></th> <th><?= lang('end') ?></th>
</tr> </tr>
</thead> </thead>
<tbody><!-- Dynamic Content --></tbody> <tbody><!-- Dynamic Content --></tbody>
</table> </table>
@ -259,8 +263,10 @@
<h4><?= lang('book_advance_timeout') ?></h4> <h4><?= lang('book_advance_timeout') ?></h4>
<div class="form-group"> <div class="form-group">
<label for="book-advance-timeout" class="control-label"><?= lang('timeout_minutes') ?></label> <label for="book-advance-timeout"
<input id="book-advance-timeout" data-field="book_advance_timeout" class="form-control" type="number" min="15"> class="control-label"><?= lang('timeout_minutes') ?></label>
<input id="book-advance-timeout" data-field="book_advance_timeout" class="form-control"
type="number" min="15">
<p class="form-text text-muted"> <p class="form-text text-muted">
<?= lang('book_advance_timeout_hint') ?> <?= lang('book_advance_timeout_hint') ?>
</p> </p>
@ -276,7 +282,7 @@
<div class="mt-2"> <div class="mt-2">
<button type="button" class="add-break btn btn-primary"> <button type="button" class="add-break btn btn-primary">
<i class="far fa-plus-square"></i> <i class="far fa-plus-square"></i>
<?= lang('add_break');?> <?= lang('add_break'); ?>
</button> </button>
</div> </div>
@ -284,12 +290,12 @@
<table class="breaks table table-striped"> <table class="breaks table table-striped">
<thead> <thead>
<tr> <tr>
<th><?= lang('day') ?></th> <th><?= lang('day') ?></th>
<th><?= lang('start') ?></th> <th><?= lang('start') ?></th>
<th><?= lang('end') ?></th> <th><?= lang('end') ?></th>
<th><?= lang('actions') ?></th> <th><?= lang('actions') ?></th>
</tr> </tr>
</thead> </thead>
<tbody><!-- Dynamic Content --></tbody> <tbody><!-- Dynamic Content --></tbody>
</table> </table>
@ -341,7 +347,8 @@
<div class="form-group"> <div class="form-group">
<div class="form-group"> <div class="form-group">
<div class="custom-control custom-checkbox"> <div class="custom-control custom-checkbox">
<input class="custom-control-input" type="checkbox" id="display-terms-and-conditions"> <input class="custom-control-input" type="checkbox"
id="display-terms-and-conditions">
<label class="custom-control-label" for="display-terms-and-conditions"> <label class="custom-control-label" for="display-terms-and-conditions">
<?= lang('display_terms_and_conditions') ?> <?= lang('display_terms_and_conditions') ?>
</label> </label>
@ -351,7 +358,8 @@
<div class="form-group"> <div class="form-group">
<label><?= lang('terms_and_conditions_content') ?></label> <label><?= lang('terms_and_conditions_content') ?></label>
<textarea id="terms-and-conditions-content" cols="30" rows="10" class="form-group"></textarea> <textarea id="terms-and-conditions-content" cols="30" rows="10"
class="form-group"></textarea>
</div> </div>
<h4><?= lang('privacy_policy') ?></h4> <h4><?= lang('privacy_policy') ?></h4>
@ -384,7 +392,7 @@
<form> <form>
<div class="row"> <div class="row">
<fieldset class="col-12 col-sm-6 personal-info-wrapper"> <fieldset class="col-12 col-sm-6 personal-info-wrapper">
<legend class="border-bottom mb-4"> <legend class="border-bottom mb-4">
<?= lang('personal_information') ?> <?= lang('personal_information') ?>
<?php if ($privileges[PRIV_USER_SETTINGS]['edit'] == TRUE): ?> <?php if ($privileges[PRIV_USER_SETTINGS]['edit'] == TRUE): ?>
<button type="button" class="save-settings btn btn-primary btn-sm mb-2" <button type="button" class="save-settings btn btn-primary btn-sm mb-2"
@ -446,44 +454,49 @@
<label for="notes"><?= lang('notes') ?></label> <label for="notes"><?= lang('notes') ?></label>
<textarea id="notes" class="form-control" rows="3"></textarea> <textarea id="notes" class="form-control" rows="3"></textarea>
</div> </div>
<p class="text-danger">
<small><?= lang('fields_are_required') ?></small>
</p>
</fieldset> </fieldset>
<fieldset class="col-12 col-sm-6 miscellaneous-wrapper"> <fieldset class="col-12 col-sm-6 miscellaneous-wrapper">
<legend class="border-bottom mb-4"><?= lang('system_login') ?></legend> <legend class="border-bottom mb-4"><?= lang('system_login') ?></legend>
<div class="form-group"> <div class="form-group">
<label for="username"><?= lang('username') ?> *</label> <label for="username"><?= lang('username') ?> *</label>
<input id="username" class="form-control required"> <input id="username" class="form-control required">
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="password"><?= lang('password') ?></label> <label for="password"><?= lang('password') ?></label>
<input type="password" id="password" class="form-control" autocomplete="new-password"> <input type="password" id="password" class="form-control" autocomplete="new-password">
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="retype-password"><?= lang('retype_password') ?></label> <label for="retype-password"><?= lang('retype_password') ?></label>
<input type="password" id="retype-password" class="form-control" autocomplete="new-password"> <input type="password" id="retype-password" class="form-control"
</div> autocomplete="new-password">
</div>
<div class="form-group"> <div class="form-group">
<label for="calendar-view"><?= lang('calendar') ?> *</label> <label for="calendar-view"><?= lang('calendar') ?> *</label>
<select id="calendar-view" class="form-control required"> <select id="calendar-view" class="form-control required">
<option value="default">Default</option> <option value="default">Default</option>
<option value="table">Table</option> <option value="table">Table</option>
</select> </select>
</div> </div>
<div class="form-group"> <div class="form-group">
<label for="timezone"><?= lang('timezone') ?></label> <label for="timezone"><?= lang('timezone') ?></label>
<?= render_timezone_dropdown('id="timezone" class="form-control"') ?> <?= render_timezone_dropdown('id="timezone" class="form-control"') ?>
</div> </div>
<button type="button" id="user-notifications" class="btn btn-light" data-toggle="button"> <button type="button" id="user-notifications" class="btn btn-light" data-toggle="button">
<i class="far fa-envelope"></i> <i class="far fa-envelope"></i>
<?= lang('receive_notifications') ?> <?= lang('receive_notifications') ?>
</button> </button>
</fieldset> </fieldset>
</div> </div>
</form> </form>
</div> </div>

View file

@ -188,6 +188,10 @@
<label for="provider-notes"><?= lang('notes') ?></label> <label for="provider-notes"><?= lang('notes') ?></label>
<textarea id="provider-notes" class="form-control" rows="3"></textarea> <textarea id="provider-notes" class="form-control" rows="3"></textarea>
</div> </div>
<p class="text-danger">
<small><?= lang('fields_are_required') ?></small>
</p>
</div> </div>
<div class="provider-settings col-12 col-md-6"> <div class="provider-settings col-12 col-md-6">
<div class="form-group"> <div class="form-group">
@ -431,6 +435,10 @@
<label for="secretary-notes"><?= lang('notes') ?></label> <label for="secretary-notes"><?= lang('notes') ?></label>
<textarea id="secretary-notes" class="form-control" rows="3"></textarea> <textarea id="secretary-notes" class="form-control" rows="3"></textarea>
</div> </div>
<p class="text-danger">
<small><?= lang('fields_are_required') ?></small>
</p>
</div> </div>
<div class="secretary-settings col-12 col-md-6"> <div class="secretary-settings col-12 col-md-6">
<div class="form-group"> <div class="form-group">
@ -595,6 +603,10 @@
<label for="admin-notes"><?= lang('notes') ?></label> <label for="admin-notes"><?= lang('notes') ?></label>
<textarea id="admin-notes" class="form-control" rows="3"></textarea> <textarea id="admin-notes" class="form-control" rows="3"></textarea>
</div> </div>
<p class="text-danger">
<small><?= lang('fields_are_required') ?></small>
</p>
</div> </div>
<div class="admin-settings col-12 col-md-6"> <div class="admin-settings col-12 col-md-6">
<div class="form-group"> <div class="form-group">