HTML5 number input field step attribute broken in Internet Explorer 10 and Internet Explorer 11

后端 未结 4 709
南方客
南方客 2020-12-10 14:09

It appears some of my website\'s users are experiencing issues when attempting to insert values into input fields of type number with the step attribute set.

I am usi

4条回答
  •  情书的邮戳
    2020-12-10 14:47

    IE10's HTML5 form validation is really buggy in this case, so you might want to consider disabling HTML5 form validation for this form.

    You can do this by adding a novalidate attribute to the form tag. For example, you might want to do something like this:

    Setting novalidate will tell the browser to not try to be useful, which should work out your issue. However, please be aware that this will disable the HTML5 validation for the whole form for all browsers. If you need to keep this for some browsers while removing it from IE, you'll have to add the novalidate attribute via Javascript on page load after checking the browser user agent. This user agent can be spoofed however so it's not an ideal solution.

提交回复
热议问题