howardlo
howardlo

Reputation: 1459

trigger number pad on focus in html input element

I'm working on a web application for tablets. In the application there is an input element that requires an integer input. When the user clicks on the input element usually the letter keyboard pops up and then the user has to switch to the number pad. Is there an attribute that one can specify so that the tablet pops up a number pad instead?

Upvotes: 1

Views: 1283

Answers (3)

Mateusz Rogulski
Mateusz Rogulski

Reputation: 7455

You can try <input type="number" />.

And if you want to remove arrows you can check : this answer

Upvotes: 1

joews
joews

Reputation: 30330

One of these types:

<input type="tel" ...>

<input type="number" ...>

The actual behaviour will depend on the tablet's platform. On iOS, the number keyboard has integers and arithmetic operators, and the tel keyboard has large digits and a #/* key only.

Source

Upvotes: 1

Alex Art.
Alex Art.

Reputation: 8781

Did you try number type:

<input type="number" name="quantity" min="0" max="1000" step="1">

Upvotes: 2

Related Questions