Reputation: 1000
I'm trying to figure out how to set the min and the max value of an input type="date"
.
I couldn't find anything on the web and didn't figure it out by myself.
I need to set the min and max values to verify the age.
I thought it might be something like <input type="date" min="1900-01-01" max="(year-18)-day(this month)-month(this month)">
.
Another thing is that I wanted to set the value so that the selectbox is not empty.
A link would be enough. Maybe I was searching for the wrong words.
Upvotes: 3
Views: 3949
Reputation: 1314
You need to have
value="2012-01-01"
in that format ( %Y-%m-%d ) to have the value show in the field and in the picker.
The HTML5 spec allows for max and min attributes, but Mobile Safari doesn't support it. pity.
Upvotes: 3