当前位置: 动力学知识库 > 问答 > 编程问答 >

iphone - HTML5 Date Attributes on iOS

问题描述:

I am trying to add HTML5 date picker to my website in order for iOS users to be able to use the native date picker.

I need to limit the date range e.g. dates from 01/01/2015 to 07/08/2015

I am trying to use min and max attributes as suggested, however it doesn't appear to work on iPhone or iPad. Any ideas how this can be achieved?

网友答案:

It may be the format of min and max. When I tried:

<input type="date" min="2015/01/01" max="2015/12/12" name="date">

It did not work. When I switched to

<input type="date" min="2015-01-01" max="2015-12-12" name="date">

It did work. In Chrome anyway. You would need to test in iOS.

分享给朋友:
您可能感兴趣的文章:
随机阅读: