<Script type = "text/javascript">
Function check (){
// Verification with a start time greater than the end time
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 earlier than the effective time! ");
Return;
}
Var emergency = document. form1.emergency. value;
If (emergency = "" | regnull. test (emergency )){
Alert ("Please enter the degree of urgency! ");
Document. form1.emergency. focus ();
Return;
}
Document. form1.submit ();
}
<Script>