html phonegap android : numeric soft keyboard has next instead of go button

后端 未结 2 1738
鱼传尺愫
鱼传尺愫 2021-01-02 01:14

This is driving me crazy and I can\'t find the answer anywhere.

I have forms in my phonegap app. If the input type=\"text\", the text keyboard pops up and \"go\" is

2条回答
  •  温柔的废话
    2021-01-02 01:44

    You can detect the next keyboard press by using the following bind in JQuery:

    $('input').on('keydown', function(e){
        if(e.which === 9) {
            //your code here
        }
    });
    

    The 'next' button emulates the tab keypress event on a keyboard, which is key code 9. Unfortunately, keypress and keyup events do not detect the next key event, so you need to bind it on keydown.

    Hope that helps!

提交回复
热议问题