最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to force mobile browsers to pull out numeric keyboard for input type="text"? - Stack Overflow

programmeradmin2浏览0评论

In my angularjs app, i have two input fields with type="text", pls see the plunkr here.

The problem is that the currency formatting is not possible for input type="number".

So it it possible to bring up Numeric keyborad for mobile devices when the focus move to input type="text"?

Please help

In my angularjs app, i have two input fields with type="text", pls see the plunkr here.

The problem is that the currency formatting is not possible for input type="number".

So it it possible to bring up Numeric keyborad for mobile devices when the focus move to input type="text"?

Please help

Share Improve this question edited Nov 12, 2014 at 9:23 Rory McCrossan 338k41 gold badges320 silver badges351 bronze badges asked Nov 12, 2014 at 9:21 IrshuIrshu 8,4468 gold badges55 silver badges66 bronze badges
Add a comment  | 

3 Answers 3

Reset to default 17

use "tel" I'm sure this will solve your problem. this will allow you to input alphabates also but it will open numeric keypad

<input type="tel">

Add pattern to it.

<input type="text" pattern="\d*">

Try the below. Additionally you can add "ng-pattern" to manage validation messages etc.

<input type="text" pattern="[0-9]*">

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论