4

I have a form with html5 validation ("required", etc.) attributes attached.

Is there a way to trigger the appearance of the native validation bubbles/tooltips without simulating "click" on submit buttons of the form ?

lgersman
  • 2,178
  • 2
  • 19
  • 21
  • Some interesting discussion on [whatwg.org](http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2011-September/033319.html) on this - may be helpful. – Sasidhar Vanga Dec 05 '12 at 09:43
  • Would like to know how to trigger it via javascript! – Gaʀʀʏ Dec 07 '12 at 03:47
  • 1
    My [jquery.html5validation.js](https://github.com/lgersman/jquery.orangevolt-ampere/blob/master/src/jquery.html5validation.js) jquery plugin lets the current validation message appear automagically via the native title tooltip. Look at the bottom of the source file to see the trick. – lgersman Jan 04 '13 at 09:30

2 Answers2

4

As said in a comment, you can use the .reportValidity() method. It is widely supported except for IE, as usual.

adlr0
  • 758
  • 9
  • 13
1

You just can't trigger the native browser form validation.

lracicot
  • 364
  • 2
  • 15