469,326 Members | 1,359 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,326 developers. It's quick & easy.

How to force numeric keypad from an input box (HTML)

yarbrough40
320 100+
I built a web-based application (HTML) optimized for mobile devices. Is there any way to force the numeric pad to come up when clicking an input box (as opposed to the qwerty default)?
Jun 2 '11 #1

✓ answered by markmcgookin

This is difficult because a "numeric keypad" is a device specific thing.... There may be a way to mask the box so that it can only accept numbers, mobile OSs might be able to pick this up and only show a numeric keypad, but you'll need to refer to each OSs specific documentation to find out if this is possible and what the triggers for such a response would be.

5 10669
markmcgookin
648 Expert 512MB
This is difficult because a "numeric keypad" is a device specific thing.... There may be a way to mask the box so that it can only accept numbers, mobile OSs might be able to pick this up and only show a numeric keypad, but you'll need to refer to each OSs specific documentation to find out if this is possible and what the triggers for such a response would be.
Oct 4 '11 #2
yarbrough40
320 100+
Thanks, yeah I figured this was the case.
Oct 4 '11 #3
there is a solution for your problem.
Use this in your css and your mobile input will be forced to give only number keypad means only numbers will be entered.
<input type="text" style="-wap-input-format: 'N'"/>
Dec 31 '11 #4
yarbrough40
320 100+
Nice! Thanks..... I'll give it a try
Jan 2 '12 #5
Or the new HTML5 input types:

Expand|Select|Wrap|Line Numbers
  1. <input type="tel">
  2. <input type="number">
Will bring up the appropriate keypad if the mobile browser supports it. If not, then it is treated like a text field for backwards compatibility.

More: http://www.456bereastreet.com/archiv...5_input_types/
Jan 14 '12 #6

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Melson | last post: by
4 posts views Thread by Dennieku | last post: by
24 posts views Thread by Gary Hasler | last post: by
4 posts views Thread by Steve Swift | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.