diff --git a/static/js/createcommision.js b/static/js/createcommision.js index d61791d..650267e 100644 --- a/static/js/createcommision.js +++ b/static/js/createcommision.js @@ -22,38 +22,44 @@ $(document).ready(function () { } else { secretars.push(element.fio) } + if (element.predsed == 1) { preds.push(element.fio) } }); + console.log(preds) + console.log(secretars) + console.log(alluchs) - for (i = 0; i < preds.length; i++) { - let newOption = new Option(preds[i], preds[i]) + preds.forEach( function (item) { + let newOption = new Option(item, item) predsel.appendChild(newOption) - } + }) + - alluchs.forEach(function (item) { - let newOption = new Option(item, item) - uch1.appendChild(newOption); - }) - alluchs.forEach(function (item) { - let newOption = new Option(item, item) - uch2.appendChild(newOption); - }) - alluchs.forEach(function (item) { - let newOption = new Option(item, item) - uch3.appendChild(newOption); - }) - alluchs.forEach(function (item) { - let newOption = new Option(item, item) - uch4.appendChild(newOption); - }) secretars.forEach(function (item) { let newOption = new Option(item, item) secretar.appendChild(newOption) }) + + + alltagych = Array.from( $('select[id^="uchgak"]')) + + + alltagych.forEach(function (alltagychItem) { + alluchs.forEach(function (item) { + const option = document.createElement('option'); + option.value = item; + option.textContent = item; + alltagychItem.appendChild(option) + }) + }) + + + + }); }); diff --git a/static/js/settings.js b/static/js/settings.js index 3e8ebd1..48f88ff 100644 --- a/static/js/settings.js +++ b/static/js/settings.js @@ -27,6 +27,7 @@ btnadd.onclick = function (){ } ) + document.getElementById("fio").value = ""; document.getElementById("predsedatel").checked = false; document.getElementById("recentzent").checked = false; diff --git a/templates/createCommision.html b/templates/createCommision.html index 856da98..c0f6144 100644 --- a/templates/createCommision.html +++ b/templates/createCommision.html @@ -19,14 +19,14 @@