安卓的PhoneGap - 数字键盘只 [英] Android PhoneGap - numeric keyboard only

查看:160
本文介绍了安卓的PhoneGap - 数字键盘只的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用下面的code。在我的项目,它的精细工作:

I'm using the following code in my project and it's working fine:

<一个href="http://wiki.phonegap.com/w/page/27915465/How%20to%20show%20and%20hide%20soft%20keyboard%20in%20Android">"How显示和隐藏Android的软键盘

不过,我想用数量键盘更换键盘。我不希望它在全球范围,所以我猜我会不会有编辑XML文件。它只能是数字,当我从JavaScript调用它。

However, I would like to replace the keyboard with the "number" keyboard. I don't want it globally, so I'm guessing I won't have to edit the xml file. It should only be numeric when I call it from the javascript.

推荐答案

您可以在点击输入任何类型的键盘时根据其类型

You can get any kind of Keyboard when you tap an input depending on its type

有关数字键盘,你需要将其类型设置为数字

For a numeric keyboard, you need to set its type to number

<input type="number" name="txtNumber"/>

这篇关于安卓的PhoneGap - 数字键盘只的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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