iOS 5:设置输入类型的最小值和最大值=“日期”

发布于 2024-12-21 03:23:31 字数 263 浏览 2 评论 0原文

我试图弄清楚如何设置 input type="date" 的最小值和最大值。 我在网上找不到任何东西,也没有自己弄清楚。

我需要设置最小值和最大值来验证年龄。 我认为它可能类似于

另一件事是我想设置该值以使选择框不为空。

一个链接就足够了。也许我正在寻找错误的词语。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

冬天旳寂寞 2024-12-28 03:23:31

您需要采用

value="2012-01-01" 

该格式 ( %Y-%m-%d ) 才能在字段和选择器中显示值。

HTML5 规范允许 max 和 min 属性,但 Mobile Safari 不支持。遗憾。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文