Synchro
Synchro

Reputation: 21

How do I call a full numeric keyboard on Samsung phones via html (input type=number)?

Currently whenever I have an input type=number field the keyboard that opens on my Samsung S7 is a very simplified numeric input that doesn't allow for negative numbers, ideally how do I let the phone see that I am looking for a fuller keyboard? I would like this to be possible on all types of phones.

Upvotes: 1

Views: 944

Answers (1)

DaveP
DaveP

Reputation: 568

tl;dr - You can't (with any certainty), until the inputmode attribute is available, which isn't going to be any time soon.

Longer version - <input type='number'> is currently interpreted by device/OS manufacturers as they see fit. There is no other standard way AFAIK of hinting to a device what kind of keyboard should show up on focussing that field.

That said, you might be able to have some influence on some devices by using hacks like that suggested by Chris Coyier, using e.g. <input type="text" pattern="[0-9]*"> which does apparently work for IOS5. Whether or not that works for any other versions of IOS or your Samsung S7 or for each of the other millions of different phones/devices out there is another matter...

Upvotes: 1

Related Questions