function zhsearchform() { var yearary=[]; var datestyle=['年 ','月 ','日 ']; var startyear=2006; var endyear=2010; var morenstartdate='2007-11-13'.split('-') var morenenddate='2008-11-13'.split('-') var monthary=[1,2,3,4,5,6,7,8,9,10,11,12]; var dayary=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31]; this.startdateform=['startyear','startmonth','startday'] this.enddateform=['endyear','endmonth','endday'] var classform='classid' this.classform=[]; for(var i=startyear;i\n') for(var i=0;i'+yearary[i]+'\n') } document.write('\n') document.write(datestyle[0]) document.write('\n') document.write(datestyle[1]) document.write('\n') document.write(datestyle[2]) } this.drawenddate=function(moren) { if(moren==null) moren=morenenddate else moren=moren.split('-') if(moren.length!=3) moren=morenenddate document.write('\n') document.write(datestyle[0]) document.write('\n') document.write(datestyle[1]) document.write('\n') document.write(datestyle[2]) } this.drawclass=function(moren,text,style) { document.write('\n') } this.formcheck=function(formname) { var tempstartdate='' var tempenddate='' tempstartdate=formname[this.startdateform[0]].value+'-'+formname[this.startdateform[1]].value+'-'+formname[this.startdateform[2]].value tempenddate=formname[this.enddateform[0]].value+'-'+formname[this.enddateform[1]].value+'-'+formname[this.enddateform[2]].value with(formname) { execScript('DateValidate = isdate("'+tempstartdate+'")','vbscript'); if(!DateValidate) { alert("开始时间不是正确的日期"); formname[this.startdateform[0]].focus(); return false } execScript('DateValidate = isdate("'+tempenddate+'")','vbscript'); if(!DateValidate) { alert("结束时间不是正确的日期"); formname[this.enddateform[0]].focus(); return false } execScript('DateValidate = datediff("d","'+tempenddate+'","'+tempstartdate+'")','vbscript'); if(DateValidate>=0) { alert("结束时间不能早于开始时间!"); formname[this.enddateform[0]].focus(); return false } } } return this; }