mirror of
https://github.com/Theodor-Springmann-Stiftung/musenalm.git
synced 2025-10-30 09:45:31 +00:00
Basis Suche Inhalte
This commit is contained in:
@@ -14,4 +14,38 @@
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
const form = document.getElementById("simplesearchform");
|
||||
let submitBtn = null;
|
||||
if (form) {
|
||||
submitBtn = form.querySelector("#submitbutton");
|
||||
}
|
||||
|
||||
function checkValidity(f, btn) {
|
||||
if (f.checkValidity()) {
|
||||
btn.disabled = false;
|
||||
} else {
|
||||
btn.disabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (form && submitBtn) {
|
||||
checkValidity(form, submitBtn);
|
||||
form.addEventListener("input", (event) => {
|
||||
checkValidity(form, submitBtn);
|
||||
});
|
||||
}
|
||||
|
||||
const lookupform = document.getElementById("lookupform");
|
||||
let lookupsubmitBtn = null;
|
||||
if (lookupform) {
|
||||
lookupsubmitBtn = lookupform.querySelector("#submitbutton");
|
||||
}
|
||||
|
||||
if (lookupform && lookupsubmitBtn) {
|
||||
checkValidity(lookupform, lookupsubmitBtn);
|
||||
lookupform.addEventListener("input", (event) => {
|
||||
checkValidity(lookupform, lookupsubmitBtn);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
21
views/routes/suche/components/_musenalmidbox.gohtml
Normal file
21
views/routes/suche/components/_musenalmidbox.gohtml
Normal file
@@ -0,0 +1,21 @@
|
||||
{{ $p := index . 0 }}
|
||||
{{ $t := index . 1 }}
|
||||
<form
|
||||
id="lookupform"
|
||||
class="w-full font-serif grid grid-cols-12 gap-x-4 mb-4"
|
||||
method="get"
|
||||
action="/suche/{{- $t -}}"
|
||||
autocomplete="off">
|
||||
<label for="almstring" class="col-span-3 align-middle hidden">Almanach-Nummer:</label>
|
||||
<input
|
||||
autocomplete="off"
|
||||
minlength="1"
|
||||
required="true"
|
||||
type="search"
|
||||
name="almstring"
|
||||
id="almstring"
|
||||
value="{{ $p }}"
|
||||
placeholder="Alm-Nummer"
|
||||
class="w-full col-span-3 placeholder:italic" />
|
||||
<button id="submitbutton" type="submit" class="col-span-2">Nachschlagen</button>
|
||||
</form>
|
||||
Reference in New Issue
Block a user