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
Regex to Match All HTML Tags Except <P> and </P>
Uiwebview with Contenteditable (HTML Editing), First Responder Handling
How to Have Two Items on Opposite Sides on The Same Line
What Is The Correct Readonly Attribute Syntax for Input Text Elements
Making an Svg Image Object Clickable with Onclick, Avoiding Absolute Positioning
HTML - Two Tables Side by Side
How to Force Download with HTML/JavaScript
File Opens Instead of Downloading in Internet Explorer in a Href Link
How to Horizontal & Vertical Center a Div
Conditional Rendering of Non-Jsf Components (Plain Vanilla HTML and Template Text)
Chrome Does Not Expand Flex Parent According to Children's Content
Button Image as Form Input Submit Button
How to Send HTML Email Using R