Skip to content
● Grav 2.2 is out: 2x faster cold starts and 96% less memory on big sites. Read the announcement →

Date picker in contact form

Solved by pamtbaau View solution

Started by elisabetta 5 years ago · 4 replies · 1000 views
5 years ago

HI all. I need to add two date picker fields to a contact form (they should enable the customers of a B&B to choose the from/to dates for their staying).
I use the "Example contact form" displayed in GRAV documentation.
Any idea how to add these fields?
Thanks in advance!

5 years ago

OOOPS! Completely my fault!! I read the documentation related to the admin Plugin :upside_down_face:
Now I tried with your link and it works!
Can you explain the meaning of "Validate min" and validate max? I'm a bit confused about that..

5 years ago

@maria, I can imagine the docs are a bit confusing...

Try:

YAML
validate:
    min: "2022-01-01"
    max: "2022-01-10"

You will see that the dropdown allows the user to only pick (or enter) a date between Jan. 1st and Jan. 10th

Note the ISO format of the date.

5 years ago

Thank you sooooo much! It's perfectly clear now 🙂

Suggested topics

Topic Participants Replies Views Activity
Forms & Blueprints · by Japhy, 2 weeks ago
2 294 6 days ago
Forms & Blueprints · by FrViPofm, 1 month ago
5 342 1 month ago
Forms & Blueprints · by Ton Haarmans, 6 years ago
13 2337 8 months ago
Forms & Blueprints · by Hugo Oliveira, 9 months ago
0 803 9 months ago
Forms & Blueprints · by Flachy Joe, 10 months ago
9 881 10 months ago