我想验证我的文本框接受学年作为格式输入 YYYY-YY。如何为此编写正则表达式验证/ jQuery客户端验证功能?Jquery功能验证
function parseDate() {
alert("yeah");
var sAcadYearName = document
.getElementById('<%= txtAcademicYearName.ClientID%>');
var m = sAcadYearName.match(/^(\d{1,2})\/(\d{1,2})\/(\d{4})$/);
return (m) ? new Date(m[3], m[2] - 1, m[1]) : null;
}
你使用任何验证插件? –
@Arun nope我不是。 – MusicLovingIndianGirl
在这种情况下,你需要去进行基于正则表达式的验证 –