i'm developing a survey form for iPad using HTML5, CSS3 & Jquery. At requirement, in Postal Code show immediately numeric keyboard instead of characters keyboard then have to choose button to switch number keyboard. So in javascript, is it possible to do it ? if it is, how to do it ? please give some suggestion. Thanks all in advanced.
i'm developing a survey form for iPad using HTML5, CSS3 & Jquery. At requirement, in Postal Code show immediately numeric keyboard instead of characters keyboard then have to choose button to switch number keyboard. So in javascript, is it possible to do it ? if it is, how to do it ? please give some suggestion. Thanks all in advanced.
Share Improve this question asked Feb 15, 2012 at 3:51 NevenHuynhNevenHuynh 6,8095 gold badges23 silver badges26 bronze badges 2-
That's the HTML 5
<input type='number'>
– Michael Berkowski Commented Feb 15, 2012 at 3:54 - i have tried it but when run survey in safari on iOS 5.0.1, the keyboard did not appear and can not focus or enter in the input with type='number' attribute – NevenHuynh Commented Feb 15, 2012 at 7:33
2 Answers
Reset to default 1I haven't tried it on my iPad to see which keyboard is displayed but if there is a way I'm sure it would be the HTML 5 Input Type. This is what the new input type is supposed to do. I would be mildly surprised if the iPad didn't behave as expected when you have the correct type set.
Try this code:
<input type="number" name="mynumber"...>
Update: It does work on my iPhone (iOS 5.0.1). It doesn't pull up the "numeric only" keyboard like you get when you are unlocking the phone, but it does pull up the "numbers and symbols" keyboard like you get when you click the "123" button on the normal keyboard.
Update: Type changed from 'numeric' to 'number'
Hey you can add a attribute in your input as inputmode="numeric" Example bellow:
$("input").attr("inputmode", "numeric");
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745253375a4618809.html
评论列表(0条)