Bootstrap with JQuery Validatation

If you have a problem using JQuery validation with .form-group bootstrap as below :

Here the code to initialize the JQuery Validatation

        errorElement: 'span',
        errorClass: 'help-block',
        highlight: function (element) { // hightlight error inputs
                .closest('.form-group').removeClass('has-success').addClass('has-error'); // set error class to the control group
        unhighlight: function (element) { // revert the change done by hightlight
                .closest('.form-group').removeClass('has-error'); // set error class to the control group
		errorPlacement: function(error, element) {
        if(element.parent('.input-group').length) {
			} else {

You may also like...

Popular Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.