aboutsummaryrefslogtreecommitdiff
path: root/quotes/public/script.js
diff options
context:
space:
mode:
Diffstat (limited to 'quotes/public/script.js')
-rw-r--r--quotes/public/script.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/quotes/public/script.js b/quotes/public/script.js
index d848814..4c19953 100644
--- a/quotes/public/script.js
+++ b/quotes/public/script.js
@@ -1,15 +1,18 @@
const dropdown = document.getElementById("author");
const classes = ["TGM13.1", "TGM13.2", "TGTM13.1", "TGI13.1", "TGI13.2", "teacher"];
-dropdown.insertAdjacentHTML("beforeend", '<option selected="true" disabled>Author auswählen...</option>');
-dropdown.insertAdjacentHTML("beforeend", `<option disabled>--${classes[0]}--</option>`);
+dropdown.insertAdjacentHTML(
+ "beforeend",
+ '<option disabled value="" selected="true" disabled>Author auswählen...</option>',
+);
+dropdown.insertAdjacentHTML("beforeend", `<option disabled value="">--${classes[0]}--</option>`);
function appendOption(response) {
response.forEach((elem, i) => {
dropdown.insertAdjacentHTML(
"beforeend",
(response[i - 1 < 0 ? 0 : i - 1]["class_id"] !== elem["class_id"]
- ? `<option disabled>--${classes[elem["class_id"] - 1]}--</option>`
+ ? `<option disabled value="">--${classes[elem["class_id"] - 1]}--</option>`
: "") +
`<option value="${elem["id"]}">${elem["name"]} ${elem["middlename"] ? elem["middlename"] + " " : ""}${
elem["surname"]