0

How can I prevent the browser from showing the default HTML 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);
TylerH
  • 20,799
  • 66
  • 75
  • 101

1 Answers1

0

If you want to disable client side validation for a form in HTML5 add a novalidate attribute to the form element. like this :

<form method="post" action="/mycation" novalidate>...</form>
Kishan Oza
  • 1,707
  • 1
  • 16
  • 38