如何获得下在Android softkeyboard按钮代替GO按钮在PhoneGap的 [英] How to get Next button on android softkeyboard in place of Go Button in phonegap

查看:150
本文介绍了如何获得下在Android softkeyboard按钮代替GO按钮在PhoneGap的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发PhoneGap的应用程序,并有许多投入应用形式。我收到的android.I键盘转到按钮要与下一个按钮代替Go按钮。由于点击开始按钮(如图图)提交表单。 在Android原生,我们可以在XML中指定下一个按钮,但对于PhoneGap的如何在地方去按钮指定下一个按钮? 一些三星设备在默认情况下在上面下一步$ P $光伏按钮。

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.

在默认情况下没有开始按钮。我需要下一步但在PhoneGap的。是否有任何插件,用于指定为Android。

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将始终显示开始按钮,表单输入字段。 去基本上反映了相同的行为,作为一个正常的浏览器与一个确定按钮;键盘。您可以利用以下code

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
       }

如果你输入的字段越多,那么数据的依赖将是最好的解决方案。 如果您提交表单要prevent用户,可以使用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" />

这将焦点移到下一个字段的形式,直到它的最后一个字段。一旦最后一个到达现场,你可以允许它作为进入。所以基本上去将保持移动焦点到下一场,直到它的最后一个字段和放大器;然后,将提交表单。

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 softkeyboard按钮代替GO按钮在PhoneGap的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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