A jQuery Validate Unobtrusive extension for Bootstrap 3
If you liked it, buy me a beer!
You can get it on Nuget from the package manager console:
PM> Install-Package jquery.validate.unobtrusive.bootstrap
or on Bower:
$ bower install jquery.validate.unobtrusive.bootstrap
Just include the javascript after jquery.validate.unobtrusive and that's it!
<script src="jquery-1.10.2.min.js"></script>
<script src="bootstrap.min.js"></script>
<script src="jquery.validate.min.js"></script>
<script src="jquery.validate.unobtrusive.min.js"></script>
<script src="jquery.validate.unobtrusive.bootstrap.min.js"></script>
If your form has dynamic added elements that need validation, you can call .validateBootstrap(true)
to rebuild all validations with the new elements included
<script>
$('form').validateBootstrap(true);
</script>
Licensed under the MIT License.