Contact form: set min date to today on event date picker
This commit is contained in:
parent
252865f626
commit
33116e6c02
@ -10,8 +10,15 @@
|
||||
const submitBtn = document.getElementById('submitBtn');
|
||||
const textarea = form.querySelector('textarea[name="message"]');
|
||||
const phoneInput = form.querySelector('input[name="phone"]');
|
||||
const dateInput = form.querySelector('input[name="eventDate"]');
|
||||
let selectedFiles = [];
|
||||
|
||||
// Forbid past dates (today is allowed)
|
||||
if (dateInput) {
|
||||
const t = new Date();
|
||||
dateInput.min = `${t.getFullYear()}-${String(t.getMonth()+1).padStart(2,'0')}-${String(t.getDate()).padStart(2,'0')}`;
|
||||
}
|
||||
|
||||
// Textarea auto-resize
|
||||
textarea.style.overflow = 'hidden';
|
||||
textarea.addEventListener('input', function () {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user