如何获得下一步按钮在Android的软键盘上,以取代Go按钮在phonegap [英] How to get Next button on android softkeyboard in place of Go Button in phonegap

查看:137
本文介绍了如何获得下一步按钮在Android的软键盘上,以取代Go按钮在phonegap的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发Phonegap应用程序,并有许多应用程序形式的输入。我得到android的键盘上的Go按钮。我想用下一个按钮替换go按钮。点击Go按钮(如图所示)提交表单。
在Android本机中,我们可以在XML中指定下一个按钮,但对于PhoneGap如何指定下一个按钮代替go按钮。
一些三星设备默认下一页上一页按钮。

I am developing Phonegap application and have many inputs in application form. I am getting Go button on keyboard of android.I want to replace go button with next button. As clicking on Go button (as shown in image) submits form. In android native we can specify next button in XML but for Phonegap how to specify next button in place of go button.? Some Samsung devices have by default Next Prev button on top.

默认情况下有Go按钮。我需要Next,但在Phonegap。

By Default there is Go button. I need Next but in Phonegap. is there any plugin for specifying that for android.

推荐答案

有一个下一步按钮而不是开始是不可能的Android现在。

Having a "Next" button instead of "Go" is not possible with Android as of now.

Android将始终显示Go按钮表单输入字段。 Go基本上反映了与在普通浏览器和浏览器上的Enter按钮相同的行为。键盘。你可以通过下面的代码实现

Android will always display "Go" button for form input fields. "Go" is basically reflecting the same behavior as of an "Enter" button on a normal browser & keyboard. You can achieve through below code

if (event.keyCode == 13) {
           //Handling "Go" Button to move to next input field
       }

如果你的输入字段更多,那么数据依赖将是最好的解决方案。
如果要阻止用户提交表单,可以使用javascript在表单上输入必需的验证,其中u可以在输入字段中指定需要的数据依赖性,这有助于将光标移动到您指定的特定字段

if your input fields are more, then data-dependency will be best solution. If you want to prevent users from submitting the form, you can put required validations on the form using javascript, where u can specify data-dependency inside input field with required, which helps move cursor to a particular field which you specified in data-dependency.

<input type="text" id="first" data-dependency="second" />
<input type="text" id="second" data-dependency="third" />
<input type="text" id="third" />

它将焦点移动到窗体中的下一个字段,直到它的最后一个字段。一旦最后一个字段到达,你可以允许它作为进入。所以基本上Go会继续移动焦点到下一个字段,直到它的最后一个字段&然后将提交表单。

it move focus to next fields in form until its your last field. Once last field reaches you can allow it to act as enter. So basically Go will keep moving focus to next fields until its your last field & then will submit the form.

这篇关于如何获得下一步按钮在Android的软键盘上,以取代Go按钮在phonegap的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆