Venkatesh Paruchuri
Venkatesh Paruchuri

Reputation: 15

how to open numeric keyboard in tablet for input type text

My code look like this

<div id="example4" class="autotabbed">
<input type="text" onkeypress='return event.charCode >= 48 && event.charCode <= 57' maxlength="1" class="adr_dgt autotabbed" size="1" placeholder="x" />
</div>

when I open this in tablet how to get numeric keypad

Upvotes: 0

Views: 1366

Answers (2)

Saiyam Gambhir
Saiyam Gambhir

Reputation: 536

<div id="example4" class="autotabbed">
  <input type="number" onkeypress='return event.charCode >= 48 && event.charCode <= 57' maxlength="1" class="adr_dgt autotabbed" size="1" placeholder="x" />
</div>

On focus this will open the numeric keypad on tablets and phones.

Upvotes: 0

Alvaro
Alvaro

Reputation: 511

Try with

input type="number" 

That should work

Upvotes: 1

Related Questions