更换软键盘与下一步的PhoneGap上的Go按钮 [英] Replace Go button on soft keyboard with Next in Phonegap

查看:616
本文介绍了更换软键盘与下一步的PhoneGap上的Go按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

PhoneGap的输入类型的文本显示走软键盘上的键,我有多个文本框所以想在键盘的下一个按钮,以便用户可以方便地和最后的输入将要走得那么用户可以preSS提交表单。

Phonegap input type text show Go button on soft keyboard, I have multiple text boxes so want Next button on keyboard so user can move easily and on last input want Go so user can press to submit form.

和Android上kitkatt键盘上栏还没有显示下一条|。$ P $光伏按钮

And on Android kitkatt keyboard top bar also not displaying Next|Prev buttons.

推荐答案

有一个下一步按钮,而不是走输入型=文本不会与Android有可能从现在起。

Having a "Next" button instead of "Go" for input type="text" would not be possible with Android as of now.

Android将始终显示开始你是在表单中的位置的按钮表单输入字段不论。 去基本上反映了相同的行为,作为一个正常的浏览器与一个确定按钮;键盘。

Android will always display "Go" button for form input fields irrespective of the position of the field you are at in the form. "Go" is basically reflecting the same behavior as of an "Enter" button on a normal browser & keyboard.

有两种可能的黑客来接近你所需要的(仍然不会改变走出去下一步,但将有助于去充当下一步) -

There are two possible hacks to come closer to what you need (still won't change "Go" to "Next" but will help "Go" act as "Next") -

哈克1 - 劫持Enter键事件和放大器;将焦点移动到下一个字段

就像我提到的开始键复制Enter键,可以捕捉到进入使用JavaScript和放大器的关键事件;使其将焦点移到下一个字段的形式,直到它的最后一个字段。一旦最后一个到达现场,你可以允许它作为进入。所以基本上去将保持移动焦点到下一场,直到它的最后一个字段和放大器;然后,将提交表单。

Like I mentioned the "Go" key replicates the "Enter" key, you can capture the enter key event using JavaScript & make 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.

我已经回答了一个解决方案,类似的规定在这里 - 的如何触发一个标签,当用户presses输入,你可以尝试实现同样的在你的应用程序。

I have answered a solution to a similar requirement here - How to trigger a Tab when user presses Enter, you can try implementing the same in your app.

演示链接 - HTTP://$c$cpen.io/nitishdhar/pen / Gxbhm

哈克2 - 强制表单验证和放大器;将焦点移动到下一个无效的字段

如果您提交表单要prevent的用户,就可以把需要验证的形式使用Java脚本和放大器;如果某些字段没有填写,在pressing转到光标的焦点可以被带到下一个未填写现场。因此,在某种程度上给予的IM pression - pressing围棋和放大器;移动到下一个字段要填写

If you want to prevent users from submitting the form, you can put required validations on the form using java-script & if some field is not filled, upon pressing "Go" the focus of the cursor can be brought to the next "not filled" field. So in a way giving the impression of - "Pressing Go & moving to next field to be filled"

试试这个插件 - http://jqueryvalidation.org/ 此行为的方式解释就是将焦点移动到下一个需要的或无效的字段。

Try this plugin - http://jqueryvalidation.org/ this behaves in the way explained i.e moves focus to the next required or invalid field.

另外我觉得有些Android的版本显示在键盘上一些TAB键在字段之间移动,击打它不是下一步。

Also I think some android versions show some tab key on the keyboard to move between fields, buts its not Next.

所有最优秀的。

这篇关于更换软键盘与下一步的PhoneGap上的Go按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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