Last active
April 28, 2023 06:22
-
-
Save edysegura/9984108 to your computer and use it in GitHub Desktop.
How to prevent the browser from showing default HTML5 validation error message bubble?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.addEventListener('invalid', (function(){ | |
return function(e) { | |
//prevent the browser from showing default error bubble / hint | |
e.preventDefault(); | |
// optionally fire off some custom validation handler | |
// myValidation(); | |
}; | |
})(), true); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
<3