function validateDate(){
var strs = document.getElementById("a").value.split("-");
if (strs.length != 3) {
alert("分割的长度不等于3")
return false;
}
if (strs[0].length != 4 || strs[1].length != 2 || strs[2].length != 2) {
alert("年不等于4 月不等于2 日不等于2")
return false;
}
if(strs[1]=='01' || strs[1]=='03' || strs[1]=='05' || strs[1]=='07' || strs[1]=='08' || strs[1]=='10' || strs[1]=='12'){
if(strs[2]>31){
alert("大约不能大约31")
return false;
}
}
if(strs[1]=='04' || strs[1]=='06' || strs[1]=='09' || strs[1]=='11'){
if(strs[2]>30){
alert("小月不能大于30")
return false;
}
}
if(strs[0]%4==0){
if(strs[1]=='02'){
if(strs[2]>29){
alert("闰年不能大于29")
return false;
}
}
}else{
if(strs[1]=='02'){
if(strs[2]>28){
alert("平年不能大于28")
return false;
}
}
}
if(strs[1]>12){
alert("月份不能大于12")
return false;
}
alert("yes")
return true;
}