Irshu
Irshu

Reputation: 8436

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

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

Upvotes: 8

Views: 8640

Answers (3)

FraGre
FraGre

Reputation: 11

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

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

Upvotes: 0

siraj pathan
siraj pathan

Reputation: 1495

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">

Upvotes: 17

Alvin Magalona
Alvin Magalona

Reputation: 771

Add pattern to it.

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

Upvotes: 0

Related Questions