mirror of
https://github.com/HendrikRauh/dmx-interface.git
synced 2025-12-15 23:34:07 +00:00
added basic website for config
This commit is contained in:
parent
bb71af176e
commit
ace5addd8b
3 changed files with 160 additions and 0 deletions
17
static/script.js
Normal file
17
static/script.js
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
const form = document.querySelector("form");
|
||||
const dynamicInputs = form.querySelectorAll("[data-field][data-values]");
|
||||
|
||||
document.addEventListener("change", updateVisibility);
|
||||
|
||||
function updateVisibility() {
|
||||
dynamicInputs.forEach((element) => {
|
||||
const input = form.querySelector(`#${element.dataset.field}`);
|
||||
if (element.dataset.values.split("|").includes(input.value)) {
|
||||
element.classList.remove("hidden");
|
||||
} else {
|
||||
element.classList.add("hidden");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
updateVisibility();
|
||||
Loading…
Add table
Add a link
Reference in a new issue