如何给定datetime输入类型的特定范围? [英] How to give specific range to datetime input type?

查看:108
本文介绍了如何给定datetime输入类型的特定范围?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用 Phonegap 应用程式时,必须提供特定的日期范围(例如,使用者应该只能选择从现在开始10天内的未来日期)。

Working on Phonegap application, it requires to provide specific date range (for example, User should be able to pick only future dates up to 10 days from now).

在iPad中测试应用程序。我已尝试使用最小最大属性,但无法正常工作。

Testing application into iPad. I have tried with min and max attributes but not working.

<span class="field_text">Preferred Date &amp; Time</span>
<input id="checkout_datetime" type="datetime-local" class="text_box_cnt" required="required"/>

请帮助...

推荐答案

使用日期而不是datetime-local.Here是一个示例

Use date instead of datetime-local.Here is an example

<input id="checkout_datetime" type="date" min="2014-03-20" max="2014-03-30" class="text_box_cnt" />

参考 http://www.w3.org/TR/html-markup/input.date.html

这篇关于如何给定datetime输入类型的特定范围?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆