JQuery DatePicker ReadOnly

后端 未结 14 2321
温柔的废话
温柔的废话 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:59

    I set the following beforeShow event handler (in the options parameter) to achieve this functionality.

    beforeShow: function(i) { if ($(i).attr('readonly')) { return false; } }
    

提交回复
热议问题