Pergunta

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/

Foi útil?

Solução

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.

Outras dicas

Based on your jsFiddle the root cause is that you have no submit action for your form. I have updated your jsFiddle to make the button replicate the behaviour of the form control.

You can fix the bahaviour by adding an action attribute to your form element ie <field action="foo" method="post">

If you want to disable the form control, you can do so from your config.xml but I do not believe it is possible to override them.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top