Skip to content

Latest commit

 

History

History
35 lines (31 loc) · 1012 Bytes

README.md

File metadata and controls

35 lines (31 loc) · 1012 Bytes

jquery-validate-bootstrap

Overrides jQuery validator's default settings to show a bootstrap glyphicon inside input elements which have errors. Hides default error message labels and shows a tooltip on the icons instead.

Requirements

  • bootstrap (>= 3.1.1)
  • jQuery (>= 1.9.1)
  • jQuery.Validation (>= 1.10.0)
  • Microsoft.jQuery.Unobtrusive.Validation (>= 3.1.1)

Usage

<link rel="stylesheet" href="/lib/bootstrap/dist/css/bootstrap.css" />

...
<script src="/Scripts/jquery.js"></script>
<script src="/Scripts/jquery.validate.js"></script>
<script src="/Scripts/jquery.validate.unobtrusive.js"></script>
<script src="/Scripts/bootstrap.js"></script>
...
...
<script src="/Scripts/jquery.validation.bootstrap.js"></script>

<script>
    $.validator.applyBootstrap();
    $("#form1").validate(); // You don't need this line if you enabled Client Side Validation for ASP.NET MVC and using HtmlHelpers on a Model 
</script>