<SCRIPT LANGUAGE=vbscript> <!-- function datevalid datevalid = false if not isdate(InputForm.date1.value) then msgbox "日期错误" exit function end if if not isdate(InputForm.date2.value) then msgbox "日期错误" exit function end if
if cdate(date2) <= cdate(date1) then msgbox "结束日期必须大于开始日期" exit function end if datevalid=true end function --> </script>
更正<SCRIPT LANGUAGE=vbscript> <!-- function datevalid datevalid = false if not isdate(InputForm.date1.value) then msgbox "日期错误" exit function end if if not isdate(InputForm.date2.value) then msgbox "日期错误" exit function end if
if cdate(InputForm.date2.value) <= cdate(InputForm.date1.value) then msgbox "结束日期必须大于开始日期" exit function end if datevalid=true end function --> </script>
{
alert();
}
<!--
function datevalid
datevalid = false
if not isdate(InputForm.date1.value) then
msgbox "日期错误"
exit function
end if if not isdate(InputForm.date2.value) then
msgbox "日期错误"
exit function
end if
if cdate(date2) <= cdate(date1) then
msgbox "结束日期必须大于开始日期"
exit function
end if
datevalid=true
end function
-->
</script>
<!--
function datevalid
datevalid = false
if not isdate(InputForm.date1.value) then
msgbox "日期错误"
exit function
end if if not isdate(InputForm.date2.value) then
msgbox "日期错误"
exit function
end if
if cdate(InputForm.date2.value) <= cdate(InputForm.date1.value) then
msgbox "结束日期必须大于开始日期"
exit function
end if
datevalid=true
end function
-->
</script>