Reputation: 406
I have a time input, basically just:
Time: <input type="time" name="timeinput"/>
According to http://www.w3.org/TR/html-markup/input.time.html it supports the step attribute. Is it possible to use this attribute (or other means) to set the step size to 10 minutes? If so, how?
I am aware of some other solutions (e.g. datebox plugin), but I'm hoping for a purely html solution if possible. I am using the datebox plugin sometimes, but it seems pretty slow on mobile devices so I am trying to use the native time pickers when possible.
Upvotes: 15
Views: 60408
Reputation: 6150
Yes. You can specify step attribute in seconds.
However, Opera, iOS Safari, and Google Chrome don't reject non-aligned user input. A user can specify 11:59 to such time field. Then, Opera and Google Chrome show a validation error message when he tries to submit the form.
Upvotes: 13
Reputation: 370
It's possible. You just need to put seconds in step parameter, ex.
<input type="time" step="300"> <!-- 5 min step -->
Upvotes: 15
Reputation: 1103
As of iOS 9.1, iOS doesn't support max min or step.
http://caniuse.com/#feat=input-datetime
Upvotes: 2