This repository has been archived by the owner on Nov 3, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 213
Formular-Validierung (nicht vs. falsch ausgefülltes Pflichtfeld) #8044
Comments
|
@contao/developers /cc |
|
ganz klar nein. die HTML5-Validierung kann auch deaktiviert werden. Wir hatten in Contao 2.11 (wenn ich mich richtig erinnere) aber ein Snippet drin, welches jeweils zum ersten Fehler-Feld gescrollt ist. Ich glaube das hatten wir nur wegen jQuery entfernt, wäre ggf. sinnvoll als Vanilla wieder einzubauen. |
|
As discussed in Mumble on August 11th, we should add this script in the |
|
The VanillaJS version could look like this: try {
document.querySelector('#<?= $this->formId ?> .error').scrollIntoView();
} catch(e) {}scrollIntoView and querySelector are supported in all major browsers. |
|
Thank you @ausi. |
leofeyer
added a commit
to contao/core-bundle
that referenced
this issue
Oct 28, 2016
leofeyer
added a commit
to contao/comments-bundle
that referenced
this issue
Oct 28, 2016
leofeyer
added a commit
to contao/newsletter-bundle
that referenced
this issue
Oct 28, 2016
|
Implemented in contao/core-bundle@01d5598. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Zum Thema Formularvalidierung und Zurückspringen an den Seitenanfang (anstatt zur Fehlermeldung):
Bei der HTML5-Validierung geht der Fokus zum ersten Pflichtfeld, das nicht ausgefüllt wurde. Wird aber z.B. die Captcha-Frage falsch beantwortet, springt die Seite zurück an den Anfang. (Ich nehme an, das ist auch bei anderen Feldtypen so.)
Wenn die HTML5-Validierung keine falsch ausgefüllten, sondern nur leere Pflichtfelder erkennt, ist es da nicht sinnvoll, eine ergänzende JS-Kontrolle in den Core mit aufzunehmen? Sonst hat man immer wieder ein Problem bei langen Formularen oder One-Page-Websites.
The text was updated successfully, but these errors were encountered: