[Web] Highlight select boxes with missing required attrs
This commit is contained in:
@@ -187,3 +187,13 @@ nav .glyphicon {
|
|||||||
border-bottom:1px solid #f5f5f5!important;
|
border-bottom:1px solid #f5f5f5!important;
|
||||||
opacity: 0.3;
|
opacity: 0.3;
|
||||||
}
|
}
|
||||||
|
.btn-input-missing,
|
||||||
|
.btn-input-missing:hover,
|
||||||
|
.btn-input-missing:active,
|
||||||
|
.btn-input-missing:focus,
|
||||||
|
.btn-input-missing:active:hover,
|
||||||
|
.btn-input-missing:active:focus {
|
||||||
|
color: #000 !important;
|
||||||
|
background-color: #ff4136;
|
||||||
|
border-color: #ff291c;
|
||||||
|
}
|
||||||
|
@@ -107,8 +107,14 @@ $(document).ready(function() {
|
|||||||
if ($(this).prop('required')) {
|
if ($(this).prop('required')) {
|
||||||
if (!$(this).val() && $(this).prop('disabled') === false) {
|
if (!$(this).val() && $(this).prop('disabled') === false) {
|
||||||
invalid = true;
|
invalid = true;
|
||||||
|
if ($(this).is("select")) {
|
||||||
|
$(this).selectpicker('setStyle', 'btn-input-missing', 'add');
|
||||||
|
}
|
||||||
$(this).addClass('inputMissingAttr');
|
$(this).addClass('inputMissingAttr');
|
||||||
} else {
|
} else {
|
||||||
|
if ($(this).is("select")) {
|
||||||
|
$(this).selectpicker('setStyle', 'btn-input-missing', 'remove');
|
||||||
|
}
|
||||||
$(this).removeClass('inputMissingAttr');
|
$(this).removeClass('inputMissingAttr');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -219,8 +225,14 @@ $(document).ready(function() {
|
|||||||
if ($(this).prop('required')) {
|
if ($(this).prop('required')) {
|
||||||
if (!$(this).val() && $(this).prop('disabled') === false) {
|
if (!$(this).val() && $(this).prop('disabled') === false) {
|
||||||
invalid = true;
|
invalid = true;
|
||||||
|
if ($(this).is("select")) {
|
||||||
|
$(this).selectpicker('setStyle', 'btn-input-missing', 'add');
|
||||||
|
}
|
||||||
$(this).addClass('inputMissingAttr');
|
$(this).addClass('inputMissingAttr');
|
||||||
} else {
|
} else {
|
||||||
|
if ($(this).is("select")) {
|
||||||
|
$(this).selectpicker('setStyle', 'btn-input-missing', 'remove');
|
||||||
|
}
|
||||||
$(this).removeClass('inputMissingAttr');
|
$(this).removeClass('inputMissingAttr');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user