Skip to content

Instantly share code, notes, and snippets.

@edysegura
Last active April 28, 2023 06:22
Show Gist options
  • Save edysegura/9984108 to your computer and use it in GitHub Desktop.
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?
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);
@atanas-rujinov
Copy link

<3

@Dirigentas
Copy link

TY

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment