Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Show Decimal Keyboard in HTML5 iOS 7 / iOS 8

Tags:

I just have a simple question after having searched for hours now: Is there any possibility to show the decimal keyboard in webbrowsers input fields? input type="number" only shows numbers but i need a comma or dot instead in the bottom left corner.

I tried anything, pattern, step etc., but nothing brings up the decimal keyboard. I only need the numbers and a dot or comma, no A-Z or a-z or anything else.

<input type="number" id="inputNumbers" pattern="[0-9]*" size="30" min="1" max="5">

This is what i get: enter image description here

This is what i want: enter image description here

like image 719
Sithys Avatar asked Jun 23 '15 11:06

Sithys


People also ask

How do you write a decimal on iPhone?

Here's a longer answer: on an iPhone, you enter decimals by pressing the +*# button in the lower-left corner of the keypad and pressing either * or #.

How do you use decimals on a keyboard?

The decimal key can appear in two places on the US keyboard, in the bottom row of main keys to the right of 'M', or in an optional numeric keypad. The behavior should be the same regardless of which key is used to enter a decimal.


2 Answers

Checkout inputmode="decimal" starting on iOS 12.2

https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/inputmode

https://caniuse.com/#feat=input-inputmode

like image 86
vguerrero Avatar answered Sep 22 '22 08:09

vguerrero


https://github.com/mrchandoo/cordova-plugin-decimal-keyboard

Lets you configure the decimal character(instead of . you can change to , )

enter image description here

like image 33
Chandra Sekhar Walajapet Avatar answered Sep 18 '22 08:09

Chandra Sekhar Walajapet