#22003/12/6 16:40:16
<script language="javascript">
function compareDate(strDate1,strDate2) {
var tmp1=strDate1.split('/');
var tmp2=strDate2.split('/');
var date1=eval('new Date('+tmp1[2]+','+tmp1[1]+','+tmp1[0]+')');
var date2=eval('new Date('+tmp2[2]+','+tmp2[1]+','+tmp2[0]+')');
return (date2.valueOf()-date1.valueOf())>=0;
}
function doSearch()
{
var site = document.reptable.site.value;
var type = document.reptable.type.value;
var fromDate = document.reptable.fromDate.value;
var toDate = document.reptable.toDate.value;
var id = document.reptable.id.value;
var view = document.reptable.view.value;
if(id.length<1)
{
alert("请输入要查询的关键字!");
return;
}
if(fromDate.length<1)
{
alert("请输入起始日期!");
return;
}
if(toDate.length<1)
{
alert("请输入中止日期!");
return;
}
if (! compareDate(fromDate,toDate)) {
alert('起始日期不能晚于中止日期!');
return false;
}
}