JQuery DatePicker ReadOnly

后端 未结 14 2326
温柔的废话
温柔的废话 2020-12-03 04:35

When I make my datepicker read-only, I see that the user cannot type anything into the text box.

$(\"#datepicker\").attr(\'readonly\', \'readonly\');
         


        
14条回答
  •  清歌不尽
    2020-12-03 04:51

    You can set the range allowed to some invalid range so the user can't select any date:

    $("#datepicker").datepicker({minDate:-1,maxDate:-2}).attr('readonly','readonly');     
    

提交回复
热议问题