在Jquery datepicker中禁用下一个 [英] Disable Next in Jquery datepicker

查看:130
本文介绍了在Jquery datepicker中禁用下一个的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有其他方式,我不能允许用户选择下个月。
我已经经历了一些线程,但是我不想通过使用这个链接

  function bindPicker(){
$ input [type = text] [id * = Date])。datepicker({
changeMonth:true,
changeYear:true,
yearRange:-100:+0,
showOn:both,
buttonImage:../../images/Calender.png,
buttonImageOnly:true,
dateFormat:M-yy
});
}


解决方案

尝试将maxDate选项设置为0,这将最大日期设置为今天的+0天。

  $(。datepicker)。datepicker({maxDate :'0'}); 

更多信息: http://api.jqueryui.com/datepicker/#option-maxDate


Is there any other way by which I cannot allow the user to select next months. I had gone through some threads but I don't want to disable both next and previous buttons by using step functionality as directed in this link.

 function bindPicker() {
        $("input[type=text][id*=Date]").datepicker({
            changeMonth: true,
            changeYear: true,
            yearRange: "-100:+0",
            showOn: "both",
            buttonImage: "../../images/Calender.png",
            buttonImageOnly: true,
            dateFormat: "M-yy"
        });
    }

解决方案

Try setting the maxDate option to 0, this set the max date to +0 days from today.

$(".datepicker").datepicker({maxDate: '0'});

More info: http://api.jqueryui.com/datepicker/#option-maxDate

这篇关于在Jquery datepicker中禁用下一个的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆