Merge pull request #426 from IBCornelsen/UMBE

.
This commit is contained in:
UMBENOMENA
2025-03-07 15:14:56 +01:00
committed by GitHub

View File

@@ -26,11 +26,26 @@
async function ausweisAbschicken() { async function ausweisAbschicken() {
if (!form.checkValidity()) { if (!form.checkValidity()) {
document.getElementById("formInput-1")?.classList.remove("2xl:mt-[370px]"); // Entferne die Klasse "2xl:mt-[370px]" falls vorhanden
skala.classList.add("no-scroll") document.getElementById("formInput-1")?.classList.remove("2xl:mt-[370px]");
form.reportValidity()
return // Verhindere das Scrollen (falls erforderlich)
} skala.classList.add("no-scroll");
// Zeige die Validierungsmeldungen
form.reportValidity();
// Finde das erste ungültige Feld und scrolle sanft darauf
let firstInvalidField = form.querySelector(":invalid");
if (firstInvalidField) {
let offset = 150; // Abstand für bessere Sichtbarkeit
let fieldPosition = firstInvalidField.getBoundingClientRect().top + window.scrollY;
window.scrollTo({ top: fieldPosition - offset, behavior: "smooth" });
}
return;
}
openWindowWithPost("/kundendaten", { openWindowWithPost("/kundendaten", {
ausweis, ausweis,