<div class="codetitle"> <span><a style="CURSOR: pointer" data="82427" class="copybut" id="copybut82427" onclick="doCopy('code82427')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code82427"> <br><script type="text/javascript"> <BR>function check(){ <BR>//开始时间比结束时间大的验证 <BR>var validtime = document.form1.validtime.value; <BR>var invalidtime = document.form1.invalidtime.value; <BR>var beginTimes=validtime.substring(0,10).split('-'); <BR>var endTimes=invalidtime.substring(0,10).split('-'); <BR>validtime=beginTimes[1]+'/'+beginTimes[2]+'/'+beginTimes[0]+'/'+ validtime.substring(10,19); <BR>invalidtime=endTimes[1]+'/'+endTimes[2]+'/'+endTimes[0]+'/'+invalidtime.substring(10,19); <BR>var a =(Date.parse(invalidtime)-Date.parse(validtime))/3600/1000; <BR>if(a<0){ <BR>alert("失效时间不能小于生效时间!"); <BR>return; <BR>} <BR>var emergency = document.form1.emergency.value; <BR>if(emergency==""||regnull.test(emergency)){ <BR>alert("请输紧急程度!"); <BR>document.form1.emergency.focus(); <BR>return; <BR>} <BR>document.form1.submit(); <BR>} <BR><script> <BR></script> </div>