0

I'm currently writing a hybrid web app that will eventually be shipped to both Android and iOS. In the app, I require that the user be able to enter decimals.

Currently on Android, using input type="tel" works as required, it allows me to enter numeric data and it allows a decimal to be placed between them. On iOS however, I'm faced with numbers and some symbols, no period:

No period on iOS tel keyboard

The only reason I ask - instead of just using type="number" is simply because I use a native banking app that allows a period on the keyboard input, so I was hoping it was something you could achieve possibly with the assistance of a Cordova / Ionic plugin?

Grant
  • 5,709
  • 2
  • 38
  • 50
  • Seems my post is a duplicate of https://stackoverflow.com/questions/27103646/html5-input-type-number-with-regex-pattern-in-mobile and also https://stackoverflow.com/questions/24407109/new-webkits-convert-decimal-comma-to-dot-and-vice-versa-in-number-type-inputs – Grant Jul 09 '18 at 15:20

2 Answers2

1

I don't have an iOS device to test but I would try: input type="tel" inputmode="numeric"

G Cadogan
  • 183
  • 1
  • 9
  • Unfortunately no, that just gets rid of the up & down arrows on standard html. Thanks anyway. – Grant Jul 09 '18 at 15:19
1

For Ionic / Cordova - I found a fix here which I have forked and adjusted, as the original repo wasn't installing for me.

https://github.com/gbrits/cordova-plugin-ios-decimal-keyboard

keyboard with period on ios

Ah, 1:30am - now I can sleep free of the neurotic desire to fix the problem. (or should I say 1.30am)

Grant
  • 5,709
  • 2
  • 38
  • 50