0

How to remove standard validation tooltip after .reportValidity() using css

validation tooltip message

Any ideas?

3 Answers3

1

The keyword is: "standard". It's not possible to modify (this includes hiding) the actual tooltip because it's a browser native implementation, at least, not possible for major browser engines like Blink, Webkit and Gecko, namely Chromium, Safari and Firefox respectively.

References:

Rick Stanley
  • 732
  • 2
  • 9
  • 23
0
<form novalidate> ... </form>
tauzN
  • 5,162
  • 2
  • 16
  • 21
0

You can hide the validation tooltip by setting a custom validation message that is all whitespace. I'm not sure if it is documented somewhere or if it is a bug, but it works in Chrome and Firefox. I haven't tested other browsers.

const input = document.getElementById("name");
input.setCustomValidity(" ");
document.getElementById("btn").onclick = () => input.reportValidity();
<input id="name" placeholder="Name" required>
<button id="btn">Report validity</button>