[Web] Highlight select boxes with missing required attrs

This commit is contained in:
andryyy
2020-10-23 20:23:54 +02:00
parent 85b8b74a4c
commit 9d0d826337
2 changed files with 22 additions and 0 deletions

View File

@@ -107,8 +107,14 @@ $(document).ready(function() {
if ($(this).prop('required')) {
if (!$(this).val() && $(this).prop('disabled') === false) {
invalid = true;
if ($(this).is("select")) {
$(this).selectpicker('setStyle', 'btn-input-missing', 'add');
}
$(this).addClass('inputMissingAttr');
} else {
if ($(this).is("select")) {
$(this).selectpicker('setStyle', 'btn-input-missing', 'remove');
}
$(this).removeClass('inputMissingAttr');
}
}
@@ -219,8 +225,14 @@ $(document).ready(function() {
if ($(this).prop('required')) {
if (!$(this).val() && $(this).prop('disabled') === false) {
invalid = true;
if ($(this).is("select")) {
$(this).selectpicker('setStyle', 'btn-input-missing', 'add');
}
$(this).addClass('inputMissingAttr');
} else {
if ($(this).is("select")) {
$(this).selectpicker('setStyle', 'btn-input-missing', 'remove');
}
$(this).removeClass('inputMissingAttr');
}
}