码迷,mamicode.com
首页 > 其他好文 > 详细

处理开始时间和结束时间先后问题

时间:2016-03-04 10:21:57      阅读:201      评论:0      收藏:0      [点我收藏+]

标签:

//时间顺序处理
$(‘#start‘).change(function () {
startTime = $(‘#start‘).val();
endTime = $(‘#end‘).val();
if ((startTime > endTime)&&(endTime!=""))
{
dialog({
onshow: function () {
var obj = this;
this.content(‘<span class="text-danger">开始时间不能大于结束时间!</span>‘);
setTimeout(function () { obj.close() }, 1500);
},
quickClose: true
}).show();
$(‘#start‘).val("");
}
});
$(‘#end‘).change(function () {
startTime = $(‘#start‘).val();
endTime = $(‘#end‘).val();
if ((startTime > endTime) && (endTime != "")) {
dialog({
onshow: function () {
var obj = this;
this.content(‘<span class="text-danger">结束时间不能小于开始时间!</span>‘);
setTimeout(function () { obj.close() }, 1500);
},
quickClose: true
}).show();
$(‘#end‘).val("");
}
});

处理开始时间和结束时间先后问题

标签:

原文地址:http://www.cnblogs.com/mfc-itblog/p/5241054.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!