Function checkdate () {var starttime = document. getelementbyid ("starttime "). value; // obtain the text value of the system date var endtime = document. getelementbyid ("endtime "). value; // obtain the selected date text value var astart = starttime. split ('-'); // convert to an array, which is year, month, day, and VAR aend = endtime. split ('-'); var startdate = astart [0] + "/" + astart [1] + "/" + astart [2]; vaR enddate = aend [0] + "/" + aend [1] + "/" + aend [2]; If (startdate> enddate) {$ ("# moneymessage" 2.16.html ("<font color = Red> the start date must be earlier than the end date </font>"); Return false;} return true ;}
<Script language = "JavaScript" type = "text/JavaScript"> function datacompare () {var bgtime = document. getelementbyid ("txtbegintime "). value; var edtime = document. getelementbyid ("txtendtime "). value; var begintimearray = bgtime. split ("-"); var endtimearray = edtime. split ("-"); var begintime = begintimearray [0] + "/" + begintimearray [1] + "/" + begintimearray [2]; vaR endtime = endtimearray [0] + "/" + E Ndtimearray [1] + "/" + endtimearray [2]; If (begintime> endtime) {window. Alert ("the start time must be earlier than the end time! "); Return false;} return true;} </SCRIPT>