简体   繁体   中英

Forcing Numeric Keyboard in Internet Explorer on Windows Phone 7.5

Hi I am developing a Jquery Mobile website for Windows Phone 7.5 , have an input field as such:

<input type="number" />

which unfortunately shows an alpha keyboard.

Is there any way to force a numeric keyboard?

Thanks

I found that using:

<input type="tel">

worked best for me. For windows phone (tested on 8.1) the pattern trick does not work (even though it will for iOS and possibly android). I didn't want to use type="number" since on the html that brings up the arrows to select the number in most browsers and I was doing this for a zip code so that doesn't make sense. I haven't seen any downside for using the 'tel' type on the html side.

I know this is an old question but since there aren't a lot of WP answers out there it may help someone.

Try setting the input type to:

  • type="email"
  • type="url"
  • type="tel"

Or (Ref: Text, Web, and Editing Programming Guide for iOS )

<input type="text" pattern="\d*"></input>

Related:

To force a numeric keyboard, use the following:

<input type="text" pattern="[0-9]" />

Source: http://www.w3schools.com/html5/att_input_pattern.asp

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM