Copy code code as follows:
<script type= "text/javascript" >
function Check () {
//start time than end A large time validation
var validtime = Document.form1.validtime.value;
var invalidtime = Document.form1.invalidtime.value;
var begintimes=validtime.substring (0,10). Split ('-');
var endtimes=invalidtime.substring (0,10). Split ('-');
validtime=begintimes[1]+ '/' +begintimes[2]+ '/' +begintimes[0]+ '/' + validtime.substring (10,19);
invalidtime=endtimes[1]+ '/' +endtimes[2]+ '/' +endtimes[0]+ '/' +invalidtime.substring (10,19);
var a = (Date.parse (invalidtime)-date.parse (validtime))/3600/1000;
if (a<0) {
Alert ("The expiration time cannot be less than the effective time!");
return;
}
var emergency = Document.form1.emergency.value;
if (emergency== "" | | Regnull.test (Emergency)) {
Alert ("Please lose urgency!");
Document.form1.emergency.focus ();
return;
}
Document.form1.submit ();
}
<script>