portal.mkgtu.ru/clientSide/packs/js/competitiveGroupEntranceTes...

27 lines
631 B
JavaScript
Raw Permalink Normal View History

2024-03-28 09:51:45 +03:00
function disciplineValidatorFunc(id) {
var field = $(`#${id}`);
if (field.is(":checked")) {
return false;
}
var idPart = id.split("--")[0];
var allRadio = $(`[id*="${idPart}"]`);
if (allRadio.length > 0) {
for (var index = 0; index < allRadio.length; index++) {
var radio = $(allRadio[index]);
if (!radio.is(":checked")) {
continue;
}
if (!(radio.val().length < 1 || radio.val() == "0")) {
return false;
}
}
}
return true;
}
window.disciplineValidator = disciplineValidatorFunc