Stop jquery-ui datepicker from showing in beforeShow

后端 未结 6 1968
不知归路
不知归路 2021-01-13 13:10

I wish to do something like this:

var showme = false;

$(\'#mydatepicker\').datepicker({
    beforeShow: function(input, inst) {
        if(!showme) {
               


        
6条回答
  •  暖寄归人
    2021-01-13 14:09

    It might be better to simply control the showing of the datepicker with the disable and enable method parameters.

    $('#mydatepicker').datepicker('disable'); //Don't show datepicker 
    
    $('#mydatepicker').datepicker('enable'); //Show datepicker
    

    It would seem to accomplish the same purpose that you are seeking.

提交回复
热议问题