HTML5 Input Box with Type="Number" Does Not Accept Comma in Chrome Browser

HTML5 input box with type=number does not accept comma in Chrome browser

As of now (30/08/2017), Antoine Thiry's answer seems to be no longer valid in Chrome (my version is 60.0.3112.113). Unfortunately I don't have any other suggestion, other than simulating type="number" with javascript.

Change . (point) sparator to , (comma) on input type='number' in html5

OPTION 1. use <input type="number" lang="en" value="13.5"> if you want . , and if you want , (comma) use lang="your-language" . and it will change automatically to a comma

BROWSER SUPPORT : this is not supported in every browser ( Chrome doesn't support it, Mozzila FF does. ) . so you might want to use another solution

see here more about this solution :lang input[type="number]

see snippet:

<input type="number" lang="en" value="13.5"><input type="number" lang="ro" value="13.5">

HTML 5 input type number with step=any = No decimal separator on Chrome Soft-Keyboard

I got the same problem and came accross this link: Google Chrome on Android (and only Android) Does not allow Decimal with type number and step="any"

I have not yet tested on a iDevice, but i got the problem on my Samsung Galaxy SIII.

Allow 2 decimal places in input type=number

Instead of step="any", which allows for any number of decimal places, use step=".01", which allows up to two decimal places.

More details in the spec: https://www.w3.org/TR/html/sec-forms.html#the-step-attribute



Related Topics



Leave a reply



Submit