Ipad + How to prevent the keyboard from popping up on jquery datepicker

后端 未结 4 1655
悲&欢浪女
悲&欢浪女 2021-01-02 01:19

I want to disable the keyboard popup from my Ipad so I do something like this, but it\'s not as my wish.

I have a text box:



        
相关标签:
4条回答
  • 2021-01-02 01:48

    Have you tried disabling the input field using HTML (so adding disabled="disabled")?

    0 讨论(0)
  • 2021-01-02 01:55

    That's how I managed to deal with this problem by making the browser think the user blured the input so it hides the keyboard before it has time to show :

    $('blabla')
        .datepicker(
        {
            /* options */
        })
        .on('focus',function()
        {
            $(this).trigger('blur');
        });
    

    Works well for me where many of the other solutions I found didn't !

    0 讨论(0)
  • 2021-01-02 02:04

    The right answer tends to be the simplest one.

    readonly="true"

    Is the solution

    0 讨论(0)
  • 2021-01-02 02:10

    There is a option in HTML with let's you do this kind of thing:

    readonly="true"
    

    Add this to your input field element. It will sort of "disable" the input field, but still fires events when something is done with it (like clicking on it).


    Check out W3Schools Readonly Attribute for more information.

    0 讨论(0)
提交回复
热议问题