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

时间:2022-09-27 08:55:58

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.

我想知道如何设置输入类型的最小值和最大值="date"。我在网上找不到任何东西,也没有自己弄明白。

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.

另一件事是我想要设置值,使selectbox不是空的。

A link would be enough. Maybe I was searching for the wrong words.

链接就足够了。也许我在找错误的词。

1 个解决方案

#1


3  

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.

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

The HTML5 spec allows for max and min attributes, but Mobile Safari doesn't support it. pity.

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

#1


3  

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.

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

The HTML5 spec allows for max and min attributes, but Mobile Safari doesn't support it. pity.

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