iOS 5:设置输入类型的最小值和最大值=“日期” [英] iOS 5: Set min and max value of input type="date"
问题描述
我想知道如何设置最小值和最小值 input type =date
。
我找不到任何东西在网上,并没有弄清楚自己。
我需要设置最小和最大值来验证年龄。
我以为可能会像< input type =datemin =1900-01-01max =(year-18) - day(this month)--month (本月)>
。
另一件事是我想设置值,以使selectbox不为空。 p>
一个链接就够了也许我正在搜索错误的单词。
你需要有
value =2012-01-01
在该格式(%Y-%m-%d)中,该值在字段和选择器中显示。
HTML5规范允许使用最大和最小属性,但Mobile Safari不支持。可怜。
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.
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.
这篇关于iOS 5:设置输入类型的最小值和最大值=“日期”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!