According to Apple's documentation when I setup an input element with a type of number
I should get a number keypad.
<input type="number"/>
number
: A text field for specifying a number. Brings up a number pad keyboard in iOS 3.1 and later.
Looks damn near impossible to mess up. However, when I view this simple fiddle on my iPhone or the simulator (both iOS6) the number keypad does not appear, and I get the standard alphabetic keyboard instead.
http://jsfiddle.net/Cy4aC/3/
What on earth could I possibly have messed up here?
If a keyboard isn't already visible, tap the Show Keyboard button , then tap the Formula Keyboard button to start editing a formula. To enter a number or symbol quickly on an iPad, drag down on a key and then lift your finger, or switch to the numeric keyboard on iPhone.
Go to Settings > General > Keyboard > Keyboards. Tap a language at the top of the screen, then select an alternative layout from the list.
When you are typing in iOS 11, you can swipe down on the upper row of letters to add numbers.
By default, HTML 5 input field has attribute type=”number” that is used to get input in numeric format. Now forcing input field type=”text” to accept numeric values only by using Javascript or jQuery. You can also set type=”tel” attribute in the input field that will popup numeric keyboard on mobile devices.
You need to specify the pattern:
<input type="number" pattern="\d*"/>
As a number
can be negative or with floating point, so the - and . and , should be available in the keyboard, unless you specify a digits only pattern.
As of ios 12.2 (released March 25, 2019) this solution will work and it is the simplest to implement
<input type="number" inputmode="decimal"/>
This will bring up only the number key pad without the #+* characters that come with using input="tel"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With