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

前端 未结 11 1743
野性不改
野性不改 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 14:05

    I used a slightly modified version of Rob Osborne's solution and it successfully prevented the keyboard from popping up on the iPad and iPhone.

    $(".datePicker").datepicker({
        showOn: 'button',
        onClose: function(dateText, inst) 
        { 
            $(this).attr("disabled", false);
        },
        beforeShow: function(input, inst) 
        {
            $(this).attr("disabled", true);
        }
    });
    

提交回复
热议问题