function validateEventForm(theForm){ var syear = theForm.syear.options[theForm.syear.selectedIndex].value; var smonth = theForm.smonth.options[theForm.smonth.selectedIndex].value; var sday = theForm.sday.options[theForm.sday.selectedIndex].value; var shour = theForm.shour.options[theForm.shour.selectedIndex].value; var sminute = theForm.sminute.options[theForm.sminute.selectedIndex].value; var eyear = theForm.eyear.options[theForm.eyear.selectedIndex].value; var emonth = theForm.emonth.options[theForm.emonth.selectedIndex].value; var eday = theForm.eday.options[theForm.eday.selectedIndex].value; var ehour = theForm.ehour.options[theForm.ehour.selectedIndex].value; var eminute = theForm.eminute.options[theForm.eminute.selectedIndex].value; var sDate = syear+"-"+smonth+"-"+sday+" "+shour+":"+sminute+":00" var eDate = eyear+"-"+emonth+"-"+eday+" "+ehour+":"+eminute+":00" if (!isDate(syear,smonth,sday)) {alert ("<%= calAddErrorDate %>"); return false;} if (!isDate(eyear,emonth,eday)) {alert ("<%= calAddErrorDate %>"); return false;} if (dateTimeDiff(sDate, eDate)<=0) {alert("<%= calAddErrorInvalidRange %>"); return false;} <% if canAddRecurring then %> if (theForm.RecurrenceType[1].checked && (isNaN(theForm.PeriodicAmount.value.trim()) || theForm.PeriodicAmount.value.trim().length==0 || (!isNaN(theForm.PeriodicAmount.value.trim()) && theForm.PeriodicAmount.value.trim()<1))){ alert("<%= calAddErrorPeriodic %>") theForm.PeriodicAmount.value = "1" return false } if (theForm.RecurrenceType[3].checked && (isNaN(theForm.AMonthlyOrdinal.value.trim()) || theForm.AMonthlyOrdinal.value.trim().length==0 || (!isNaN(theForm.AMonthlyOrdinal.value.trim()) && theForm.AMonthlyOrdinal.value.trim()<1))){ alert("<%= calAddErrorPeriodic %>") theForm.AMonthlyOrdinal.value = "1" return false } var ayear = 2000 var amonth = theForm.amonth.options[theForm.amonth.selectedIndex].value; var aday = theForm.aday.options[theForm.aday.selectedIndex].value; if (theForm.RecurrenceType[4].checked && !isDate(ayear,amonth,aday)) {alert ("<%= calAddErrorDate %>"); return false;} <% End If %> return validateForm(theForm); }