html - how to trigger native validation bubbletooltips for form validation using javascript ? - Stack Overflow

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

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 ?

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 ?

Share Improve this question asked Dec 5, 2012 at 8:48 lgersmanlgersman 2,2862 gold badges20 silver badges23 bronze badges 3
  • Some interesting discussion on whatwg on this - may be helpful. – Sasidhar Vanga Commented Dec 5, 2012 at 9:43
  • Would like to know how to trigger it via javascript! – Gaʀʀʏ Commented Dec 7, 2012 at 3:47
  • 1 My 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 Commented Jan 4, 2013 at 9:30
Add a ment  | 

2 Answers 2

Reset to default 5

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

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

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744785718a4593612.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信