I\'m experimenting with PhoneGap to develop some iPhone apps. PhoneGap basically wraps a UIWebView - it works well. The problem is the my app has several input fields that
Here is a list of every type compatible with iOS (4.0 and greater) web views:
http://conecode.com/news/2011/12/mobile-safari-uiwebview-input-types/
Checked on IPhone OS 3.0, this functionality was still not there, not sure why Apple just removed this handy functionality, really upset to work on this right now :(
iOS Mobile Safari also supports:
<input type="password" />
It looks like Mobile Safari supports the new HTML5 input type attributes of email, number, search, tel, and url. These will switch the keyboard that is displayed. See the type attribute.
So for example, you could do this:
<input type="number" />
And when the input box has focus, the number keyboard is shown (as if the user had the full keyboard and hit the "123" button.
If you really only want numbers, you could specify:
<input type="tel" />
And then the user would get the phone number dialing keypad.
I know this works with Mobile Safari -- I only assume it will work with UIWebView.
You need to make the change in the HTML portion of your Dashcode project:
type="text"
to type="number"
.Done.
This was possible in the first iteration of the iPhone OS - Safari would give numeric keyboards to form fields with 'zip' or 'phone' in their names - but it disappeared in iPhone OS 2.0.
PhoneGap doesn't have an API function to override this at the moment. It may be something they're working on, it'd definitely be a nifty feature.