<td style="color:white;width:75px;align:right;" >
开始时间:
</td>
<td align="left" width="130px;">
<input id="fromDate" type="text" style="width:100px;" readonly="readonly" class="datepick"/>
</td>
<td style="color:white;width:75px;align:right;">
结束时间:
</td>
<td align="left" width="130px;">
<input id="toDate" type="text" style="width:100px;" readonly="readonly" class="datepick"/>
</td>
开始时间:
</td>
<td align="left" width="130px;">
<input id="fromDate" type="text" style="width:100px;" readonly="readonly" class="datepick"/>
</td>
<td style="color:white;width:75px;align:right;">
结束时间:
</td>
<td align="left" width="130px;">
<input id="toDate" type="text" style="width:100px;" readonly="readonly" class="datepick"/>
</td>
js代码:
function clickCount(){
var fromValue = $("#fromDate").val();
var toValue = $("#toDate").val();
var date1 = Date.parse(fromValue.replace(/-/g,"/"));
var date2 = Date.parse(toValue.replace(/-/g,"/"));
if(date1 > date2){
alert("开始时间大于结束时间,请重新选择!");
return;
}
}
function clickCount(){
var fromValue = $("#fromDate").val();
var toValue = $("#toDate").val();
var date1 = Date.parse(fromValue.replace(/-/g,"/"));
var date2 = Date.parse(toValue.replace(/-/g,"/"));
if(date1 > date2){
alert("开始时间大于结束时间,请重新选择!");
return;
}
}