How to use Twitter Bootstrap popovers for jQuery validation notifications?

后端 未结 16 1676
无人共我
无人共我 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:27

    This is how I did it with Bootstrap 2.x and jQuery Validate 1.9

    $('#form-register').validate({ errorElement: 'span', errorClass:'help-inline', highlight:    function (element, errorClass) {
            $(element).parent().parent().addClass('error');
        }, unhighlight: function (element, errorClass) {
            $(element).parent().parent().removeClass('error');
        }});
    

提交回复
热议问题