Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Empfohlene Antworten

Veröffentlicht

Hallo Leute,

diese kleine Zeile sollte als Java script das Datumseingabeformat überprüfen, nur es tut es nicht. Dass nur Ziffern eigegeben werden sollen funktioniert, doch die Position der Punkte im Datumsformat wird nicht korrekt überprüft, genausowenig wie die Anzahl der Ziffern.

if (document.voiceconference.date.value.match(/(\D{2})\.(\D{2})\.(\D{4})/)

Thx

Eine Lösung dafür kann ich Dir nicht wirklich sagen, allerdings evtl. auf eine grundlegende Sache hinweisen womit das Problem nicht auftritt.

Verwende doch einfach (falls nicht durch außergewöhnliche Umstände unmöglich), mehrere Eingabefelder für das Datum, so a la "Eingabefeld_Tag . Eingabefeld_Monat . Eingabefeld_Jahr". So habe ich es immer gelöst, hat auch den Vorteil das der Anwender noch weniger falsch machen kann. Ich überprüfe dann ob ein Integer-Wert drinsteht und ober er sich im Rahmen befindet (Tag < 32, Monat < 13).

Leider taucht das gleiche Problem bei mir auch bei der Überprüfung der Uhrzeit auf: Die Länge wird nicht richtig erkannt und der : auch nicht.

if (document.voiceconference.etime.value.match(/\D\D:\D\D/))

/(\d{1,2})\.(\d{1,2})\.(\d{4})/

/d -> Ziffern

/D -> keine Ziffern

Erstelle ein Konto oder melde dich an, um einen Kommentar zu schreiben.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.