How to hide keyboard in jQueryMobile page in a Phonegap app?

后端 未结 7 580
庸人自扰
庸人自扰 2020-12-17 14:23

I have a problem with hiding keyboard in the iPhone simulator. My HTML code:

7条回答
  •  星月不相逢
    2020-12-17 15:14

    In jQuery, if you return false;, it will stop the default browser behaviour, which, in this case, is both submitting the form as well as closing the keyboard. The following should work:

    
        
        

    jQuery:

    $("#my_form").submit(function(){
        one = $('#searchBar').val();
        console.log(one);
        doSearch(one);
        $('#focusable').focus();
        return false;
    });
    

提交回复
热议问题