spring使用jquery的datebox

每次很害怕使用jquery的datebox,因为datebox有个默认值为null,所以使用required属性对datebox没用,因此,每次遇到datebox时我都会从后台传date值给它,就可以判断是否为空了,例如

<input class="easyui-datebox" id="activity_activityTime" name="activityTime" value=“${date}” style="width:300px;" required="required"/>.

2.在js里面获取datebox的input框的值时,不能使用$("#activity_activityTime").val(),而是使用$("#activity_activityTime").datebox('getValue')。

3.在js里面需要点击datebox填完时间在改变其他输入框的数据时,不能使用$("#activity_activityTime").blur()、$("#activity_activityTime").change()、$("#activity_activityTime").onfocus()等和其他input框使用的函数,而是

$("#appointment_date").datebox({
onSelect: function(date){
var appDate=$("#appointment_date").datebox('getValue');
$("input[type='checkbox']").remove();
$.post('findCourseAppointmentByDate',{date:appDate,idKey:sss},function(data){
 var dataRows=data.rows;
 if(dataRows.length>0){
 $.each(data.rows, function(index,item){
var id=item.id;
        $("#classId").append("<input type='checkbox' name='memo' value='"+item.id+"'/>"+item.className);
         });  
 }else{
 $("#classId").append("<input type='checkbox' name='memo' value='0' checked='checked'/>"+"无节次");
 }
});
}
});

转载于:https://my.oschina.net/u/659230/blog/158102

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值