ipad web application: How do I prevent the keyboard from popping up on jquery datepicker

前端 未结 11 1744
野性不改
野性不改 2020-12-02 13:42

I have a form with an date field with a jquery datepicker attached to it.

When I select the date field the datepicker pops up but then the iPad keyboard slides into

11条回答
  •  孤城傲影
    2020-12-02 13:59

    If you're using the date-timepicker the 'beforeShow' option is not available. Only adding the 'readonly' attribute to the input filed will completely disable the date picker.

    Solution is to use the 'readonly' attribute on the element and add 'ignoreReadonly: true' as an option for the date picker.

    $(function() {
         $('#datetimepicker1').datetimepicker({
    	format: 'MM-DD-YYYY',
    	minDate: moment(),
    	ignoreReadonly: true
         });
    });

提交回复
热议问题