问题
I just ran into the following problem:
In a web-app UI I want the user to input a timeframe in hours in which to respond to a message. The timeframe should be up to 72 hours. We’d love to use <input type="time">
but its limited to 24 hours max.
<input type="time">
has an optional max value. I think a default maximum of 24 hours makes sense but it would be handy if the max could get set all the way up to 99:99 hours.
Any suggestions on where I can suggest a change in the standard?
回答1:
You can try to use the number
type as:
<input type="number" min="0" max="100">
回答2:
<input type="time" name="time">
Use this in the form validation.
$this->form_validation->set_rules('time', 'time','required|max_length[100]');
Here the first time is the name in the input field and the second word time is the if we given wrong then it will display the time is wrong and required is the word or the tag used for the specific mention(i.e user should fill the field otherwise it shows that as error) and max length is the maximum length of the field area it is only possible by using the codeignetor by using the php
来源:https://stackoverflow.com/questions/30891274/input-type-time-more-than-24-hours