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

前端 未结 3 1981
故里飘歌
故里飘歌 2020-12-03 07:15

I am using a HTML5 input box with type=\"number\". Regarding to some documentations, it should be possible to enter a number with comma (not with period) if I a

3条回答
  •  无人及你
    2020-12-03 07:53

    actually, if i read the documentation correctly, pattern is not supported for type=number. hence, stick to type=text and then add pattern="..." for the front end validation. in the next step, you will then need to convert the text input into a real number if it wasn't compatible to JavaScript/computing format.

    2017 and still no good solution for this common problem...

提交回复
热议问题