Input type=“time” more than 24 hours

谁说胖子不能爱 提交于 2019-12-22 03:22:50

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!