Is it possible to hint to the client browser to use a different soft keyboard for input boxes on a web page?

StackOverflow https://stackoverflow.com/questions/16967317

Question

Some OSes (e.g. windows 8, Windows Phone) have the ability for native apps to specify what a field will contain, and hint at which soft keyboard to display. Is it possible to add these hints to regular web pages to show (for example) the email address optimised soft keyboard, or the phone number optimised soft keyboard?

Was it helpful?

Solution

It's possible to use HTML5 input types to hint to the OS as to which keyboard should be displayed.

There are numerous webpages out there that list all the new HTML5 input types and show examples of how they look on different platforms.

Windows Phone 7, which uses IE9, does not support these newer HTML5 input types.

Windows Phone 8 and Windows 8 do as they use IE10.

For a full list of feature support, there's a comparison chart from quirksmode.org and another on wufoo.com

OTHER TIPS

You can provide the same things for a web page by using one of the 13 new "input" types in HTML5. For example, if you specify "email" as an input type, IE10 Metro on Windows 8 will provide a soft keyboard that has the "@" and ".com" easily accessible. Specify "tel", and Windows Phone 8 will bring up a telephone-like keypad.

You can find out more here: W3 Schools

You can also use the inputmode attribute (spec) if you do not want to change the type attribute for any reason. This should also work for elements other than input, such as textarea or any element with contenteditable.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top