iOS 5:设置输入类型的最小值和最大值=“日期”
我试图弄清楚如何设置 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要采用
该格式 ( %Y-%m-%d ) 才能在字段和选择器中显示值。
HTML5 规范允许 max 和 min 属性,但 Mobile Safari 不支持。遗憾。
You need to have
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.