//js代码
function check(){
var sdate= dojo.widget.byId("Stime");var bdate= dojo.widget.byId("Btime");
//判断非空后比较
if(sdate.getValue()>bdate.getValue()){
alert("前置时间不能大于后置时间!");
return false;
}else{
return true;
}
}else{
return true;
}
//HTML代码
操作时间:<sx:datetimepicker id="Stime" name="smallTime" value="smallTime" displayFormat="yyyy-MM-dd"/>至
<sx:datetimepicker id="Btime" name="bigTime" value="bigTime" displayFormat="yyyy-MM-dd"/>