min/max attribute with type = date on HTML5

痴心易碎 提交于 2019-12-01 09:11:30

Some browsers like Safari and Internet Explorer does not support this functionality, this may be your problem. Write validation via Javascript.

The list of browers that support this feature can be seen at:...

http://html5test.com/compare/browser/chrome-33/firefox-27/opera-19/safari-7.0/ie-11.html

min and max attributes for date input type have very little browser support. You can use jQuery validation as a workaround.

<input id="dateInput" required="required"  min="1900-01-01" max="2099-09-13" type="date" class="form-control" id="inputDataNascimento">
<script>
    $("#dateInput").validate();
</script>
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!