Jeeva J
Jeeva J

Reputation: 3253

Trigger numeric keyboard for input in Android/IOS without HTML5

I've searched through the websites that I found the following.

Using html5, we can trigger numeric keyboard with effortless like following,

<input type='tel' />
<input type='number'/>
<input type='text' pattern='some pattern' /> (This will work in IOS and not in android)

But I am using the autoNumeric plugin to format/restrict the user input if as digits. As per the documentation of autoNumeric plugin (http://www.decorplanit.com/plugin/), autoNumeric won't work if input type='tel/number' . I tried and yes it doesn't work.

Here my requirement is,

How to enable/trigger numeric keyboard in mobile/ipad/iphone without html5 ?

Or

Is there any jquery plugin to enable/trigger numeric keyboard in mobile/ipad/iphone without html5 and with autoNumeric js (autonumeric js)?

Upvotes: 4

Views: 5654

Answers (2)

Alex Klaus
Alex Klaus

Reputation: 8934

Official workarounds from autoNumeric.js are

  1. <input type="text" pattern="\d*"> Currently works on iOS only
  2. <input type="tel" pattern="\d*"> Should work on most mobile browsers - on android devices you may get the pause and wait buttons.

If you need decimal digits, you may modify the pattern to [\d\.]*.

Upvotes: 4

Salil Dabholkar
Salil Dabholkar

Reputation: 622

As per the documentation, Version 1.9.19 added support for <input type='tel' />

So, why not use that?

Upvotes: 5

Related Questions