出生日期验证问题

时间:2017-08-18 11:12:48

标签: javascript html

我对出生日期验证有疑问。它似乎在Chrome / Firefox等中运行良好但在IE中不起作用。我们喜欢dob的格式,例如01/01/2017或1/1/2017但IE会因某种原因接受01/01/17。

<form name="patientDetailsForm" action="/saveCustomer" method="post">
<input name="dob" class="optionalbox form-control-small" id="dob" 
required="required" type="text" maxlength="10" pattern="^(?:(?:31(\/)(?:0?
[13578]|1[02]))\1|(?:(?:29|30)(\/)(?:0?[1,3-9]|1[0-2])\2))(?:(?:1[6-9]|[2-
9]\d)?
\d{2})$|^(?:29(\/)0?2\3(?:(?:(?:1[6-9]|[2-9]\d)?(?:0[48]|[2468][048]|[13579]
[26])|(?:(?:16|[2468][048]|[3579][26])00))))$|^(?:0?[1-9]|1\d|2[0-8])(\/)(?:
(?:0?[1-9])|(?:1[0-2]))\4(?:(?:1[6-9]|[2-9]\d)?\d{2})$" value="01/12/1985" 
autocomplete="off" minlength="10" maxlength="10">
<button class="button" type="submit" value="Save">Save Customer</button>
</form>

0 个答案:

没有答案