Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

5
  • 3
    Also check other validations as well such as pattern, min/max values, etc... sanalksankar.blogspot.com/2010/12/… Commented Nov 24, 2012 at 21:55
  • 10
    This causes a bug in firefox where it validates upon refresh, yet fails upon change and correction. Commented Aug 29, 2013 at 18:07
  • 12
    @RyanCharmley by using onchange="this.setCustomValidity('')" the bug will be gone. Check my answer below. Commented Apr 1, 2014 at 5:00
  • 8
    If this does not work (it does not in Safari, for example), use oninput instead of onvalid. Commented Mar 27, 2018 at 17:29
  • 4
    @Jimothy is right about this, oninput is the more universal solution, onvalid did not work even in Chrome for me. Commented Jun 11, 2018 at 15:55