How to use Twitter Bootstrap popovers for jQuery validation notifications?

后端 未结 16 1692
无人共我
无人共我 2020-11-30 16:49

I can make popovers appear using bootstrap easily enough, and I can also do validations using the standard jQuery validation plugin or the jQuery validation engine, but I ca

16条回答
  •  悲&欢浪女
    2020-11-30 17:37

    If using the above Kenny Meyer code for popups, beware that rules that check a field's content but isn't required such as a valid URL will cause the popup to not disappear upon clearing the field. See below onkeyup for solution. If anyone has a better solution, please post.

    onkeyup: function(element, event) {
                if($(element).valid())  {
                    return $(element).popover("hide");
                }
            }
    

提交回复
热议问题