1

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);
KbiR
  • 3,838
  • 4
  • 31
  • 87

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,665
  • 1
  • 13
  • 38