Search code examples
jquerycordovablackberry-10blackberry-webworks

Using Phonegap - Override Blackberry OnScreen keyboard "Next" and "Submit" buttons


Using Phonegap - Override Blackberry OnScreen keyboard "Next" and "Submit" buttons.

I have created a phongap application which is a simple web form.

Platforms : Blackberry 10 Device :- BB Q10

While entering the text in form fields there are three buttons that appear on blackberry "Previous", "Next" and "Submit". When "Submit" is clicked, it causes the page to refresh.

Same Bug/functionality can also be seen when opening facebook sign up page on Blackberry browser.

How can I override the functionality of these two buttons using phongap, jQuery or may be develop a native blackberry plugin?

For Everybody's reference I m attaching an Image which shows these buttons

On a Blackberry 10 keyboard there are two "Submit" buttons one at the bottom which works fine and fires the form submit request and other one are these which is shown in image below and on clicking causes the page to refresh.

Note :- On a Blackberry 10 keyboard there are two "Submit" buttons one at the bottom which works fine and fires the form submit request and other one are these which is shown in image above and on clicking causes the page to refresh.

I also tried this using jQuery but the refresh fires even if I do a prevent default or stop propogation.

$( "#target" ).keypress(function( event ) { if ( event.which == 13 ) { event.preventDefault(); } $.print( event );

});

http://jsfiddle.net/M66un/


Solution

  • I just reiterated your question on the BB forums, and the answer I got was:

    You can disable the bar by adding this to config.xml:

    <preference name="HideKeyboardFormAccessoryBar" value="true"/>
    

    It doesn't solve the problem of capturing/overriding the BB keyboard Submit button, but hiding the bar is sufficient for my needs, so I figured it might be for yours as well.