Seite 1 von 1

DRINGEND**IF ELSE ABFRAGE / KALENDER /FORMULARFELD ++

Verfasst: 25.09.2018, 09:29
von BigBro
Hallo, ich habe eine dringende Frage.

Ich möchte gerne in einem Formularfeld eine If / else Abfrage im Bereich JavaScript erstellen.
Und zwar habe ich ein Formularfeld in dem ich per CalenderDropDown ein individuelles Datum einstellen kann. Wenn ich dieses Feld allerdings nicht ausfülle, soll automatisch der Text "ab sofort" in das Feld eingesetzt werden. Kann mir hier jemand sagen, wie ich die if / else abfrage wäre? :?

if (Ausdruck) {
+ Anweisung
} else {
+ Anweisung
}

Re: DRINGEND**IF ELSE ABFRAGE / KALENDER /FORMULARFELD ++

Verfasst: 25.09.2018, 11:46
von BAlheit
In ein Datumsfeld kann man den Text "ab sofort" nicht eintragen.

Bernd Alheit

Re: DRINGEND**IF ELSE ABFRAGE / KALENDER /FORMULARFELD ++

Verfasst: 25.09.2018, 12:10
von BigBro
Wie könnte ich das Problem alternativ lösen?

Könnte ich ein einfaches Feld machen und dann abfragen "Wenn kein Datum eingetragen, dann schreibe "ab sofort"?
Also ohne Datumsfeld, sondern wenn man das Datum quasi händisch in ein normales Formularfeld eintragen muss. Also quasi "wenn Feld nicht ausgefüllt, dann setze "ab sofort" ein. Geht das?

Re: DRINGEND**IF ELSE ABFRAGE / KALENDER /FORMULARFELD ++

Verfasst: 25.09.2018, 13:57
von BigBro
Gibt es denn ggf. eine alternative Möglichkeit?
Also das ich beispielsweise ein normales Textfeld nehme, in dem händisch ein Datum eingetragen werden muss und wenn das Feld nicht ausgefüllt wird, dass dann automatisch "ab sofort" eingetragen wird?

Re: DRINGEND**IF ELSE ABFRAGE / KALENDER /FORMULARFELD ++

Verfasst: 25.09.2018, 17:10
von armine
Du kannst das wie in viewtopic.php?f=10&t=17015&p=34541#p34541 angehen.