Hello, i made a simple html field with a calendar where the customer can click on multiple dates.
These dates are shown in the formular but not saved (as i understand HTML content is not saved).
How can i save this content in a hidden text field? i really dont understand what i have to add to copy the content from my field 1:1 to the hidden text field?
<!-- HTML -->
<input type="text" id="datePicker" name="datePicker" placeholder="Wählen Sie bitte einen oder mehrere Tage aus,">
<!-- Flatpickr Styles und Script -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/flatpickr/dist/flatpickr.min.css">
<script src="https://cdn.jsdelivr.net/npm/flatpickr"></script>
<script src="https://npmcdn.com/flatpickr/dist/l10n/de.js"></script>
<!-- Flatpickr Konfiguration -->
<script>
flatpickr("#datePicker", {
locale: "de",
mode: "multiple", // Erlaubt Auswahl mehrerer einzelner Tage
dateFormat: "d.m.Y",
minDate: "today",
maate: "maate",
disable: [
function(date) {
// Gibt true zurück, wenn der Tag deaktiviert werden soll
// 0 = Sonntag, 6 = Samstag
return (date.getDay() === 0 || date.getDay() === 6);
}
]
});
</script>
I suggest looking at the formidable javascript examples page and model your answer after one of them, maybe this one. You need the id of both fields and you're good to go.
Hello, thank you for your reply.I think this just works for one date.With my html code, the user clicks on multiple days and in the end he sees a textfield with for example"21.07.2025, 22.07.2025, 23.07.2025, 24.07.2025"This value, i would like to save to a hidden textfield so that it will be transmitted when he sends the form. HTML does not get transmitted.Is there a way to just put this value into a textfield?Best regards Stefan
Please login or Register to submit your answer