Chrome auto formats input=number

后端 未结 8 1685
轻奢々
轻奢々 2020-12-02 16:20

I have a web application where I\'m specifying an input field to be a number using the HTML5 property type=\"number\".



        
8条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-02 16:58

    Here is a whole list of regular expressions that you can plug into the "pattern" attribute of the html input tag: HTML5 Pattern

    Here is how I am using a pattern to format the number two decimal points:

    Unfortunately it doesn't seem to work quite right on the iPad.

提交回复
热议问题