Integrating the jQuery Validation plugin with Twitter Bootstrap

Twitter Bootstrap has some nice styling for error messages in forms. Using jQuery form validation could come handy and its actually pretty easy to integrate. The question is, how do we use the Bootstrap styling along with jQuery Validation plugin? Read on for more.

I actually wanted to:

a) All the form errors should be displayed in a single alert above the form.
b) Fields with errors should be marked in red.
c) BONUS: CodeIgniter fields should ALSO be displayed in the single alert above the form.

4. In your HTML code, you should also have a .errrorHandler div that should be empty and not styled. This div will be used to place the error code coming from the Validation plugin

<div class="errorHandler"></div>

5. BONUS for CodeIgniter users: lets say you are using CodeIgniter and you also want to display your form errors in the same alert message. Just add the following to your .errorHandler div inside your HTML code:

How come the error_string method has 4 parameters?, you might ask. Actually, the explanation for that is an extension of the CI Form Validation Library. Just add the following to a file called MY_Form_validation.php and save it to /application/libraries/