校驗開始時間和結束時間 js
/**
*判斷月份是否正確
*/
function checkMonth(){
var statDateBegin = document.forms[0].statDateBegin;
var statDateEnd = document.forms[0].statDateEnd;
if(statDateBegin.value > statDateEnd.value){
alert("統計時間[開始時間]必須小於[結束時間]");
//statDateBegin.value = "";
statDateBegin.focus();
return false;
}
if(month_between(statDateBegin.value, statDateEnd.value) > 12){
alert("統計時間範圍超過12個月,請重新錄入");
//document.forms[0].statDateStart.value = "";
document.forms[0].statDateBegin.focus();
return false;
}
return true;
}