Improved LVID format

This commit is contained in:
Marcel Gansfusz
2025-02-22 02:23:59 +01:00
parent 53ce566a4c
commit 78401d110f

View File

@@ -60,7 +60,12 @@ function autocomplete(inp, type) {
} }
for (i = 0; i < arr.length; i++) { for (i = 0; i < arr.length; i++) {
if (type === "lva") { if (type === "lva") {
iname = arr[i]["lvid"] + " " + arr[i]["lvname"]; iname =
arr[i]["lvid"].slice(0, 3) +
"." +
arr[i]["lvid"].slice(3, 6) +
" " +
arr[i]["lvname"];
} else { } else {
iname = arr[i]["name"]; iname = arr[i]["name"];
} }
@@ -77,7 +82,12 @@ function autocomplete(inp, type) {
/*insert the value for the autocomplete text field:*/ /*insert the value for the autocomplete text field:*/
if (type === "lva") { if (type === "lva") {
const idx = this.getElementsByTagName("input")[0].value; const idx = this.getElementsByTagName("input")[0].value;
inp.value = arr[idx]["lvid"] + " " + arr[idx]["lvname"]; inp.value =
arr[idx]["lvid"].slice(0, 3) +
"." +
arr[idx]["lvid"].slice(3, 6) +
" " +
arr[idx]["lvname"];
lid = arr[idx]["id"]; lid = arr[idx]["id"];
} else if (type === "prof") { } else if (type === "prof") {
const idx = this.getElementsByTagName("input")[0].value; const idx = this.getElementsByTagName("input")[0].value;