iOS decimal pad in web view

Hi,


I'm looking for a way to display the decimal pad (numbers and decimal point) for an input field in an html page loaded in a UIWebView. For an UITextField this keyboard is displayed by setting the keyboard type: UIKeyboardTypeDecimalPad. Is there a way to do the same in a UIWebView?

According to the Apple docs, in a web view, you can configuresome keyboard attributes for text input elements using HTML 5 keywords and pattern attribute. And here is the list showing how to display each type of keyboard:

  • Text:
    <input type="text"></input>
  • Telephone:
    <input type="tel"></input>
  • URL:
    <input type="url"></input>
  • Email:
    <input type="email"></input>
  • Zip code:
    <input type="text" pattern="[0-9]*"></input>

I tried a few patterns with input type 'text', but none gave the decimal pad.


Thanks,

Try some javascript.

Also facing the same issue. Question raised on stackoverflow(no responses yet).


Question: Is it possible to trigger the keyboard type: decimalPad in a HTML form rendered within mobile safari (i.e. numeric keyboard with a decimal point)?


Note: While a "numeric" keyboard is possible by specifying

<input type="number" pattern="d\*" />
I have had no luck triggering a numeric keyboard with a decimal point. At this stage, it seems like this is only possible when building a native iOS application (as opposed to a web app).


Apple Documentation:https://developer.apple.com/library/safari/documentation/AppleApplications/Reference/SafariHTMLRef/Articles/InputTypes.html

iOS decimal pad in web view
 
 
Q