34 lines
642 B
JavaScript
34 lines
642 B
JavaScript
function allNameKrValid() {
|
|
var isValid = true;
|
|
|
|
$('.ajax-input-namekr').each(function () {
|
|
if ($(this).val() === '---') {
|
|
isValid = false;
|
|
return false; // break loop
|
|
}
|
|
});
|
|
|
|
return isValid;
|
|
}
|
|
|
|
function updateSelectKrDiv() {
|
|
const krDiv = $('.noKampfrichterDiv');
|
|
|
|
if (krDiv.length !== 1) {
|
|
return;
|
|
}
|
|
|
|
if (allNameKrValid()) {
|
|
krDiv.css('display', 'none');
|
|
} else {
|
|
krDiv.css('display', 'flex');
|
|
}
|
|
}
|
|
|
|
// initial check
|
|
updateSelectKrDiv();
|
|
|
|
// react to changes
|
|
$('.ajax-input-namekr').on('change', function () {
|
|
updateSelectKrDiv();
|
|
}); |