Skip to content

Commit

Permalink
Initial Check-In
Browse files Browse the repository at this point in the history
  • Loading branch information
bremussolutions committed Oct 4, 2017
1 parent 505c99a commit d77441a
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 0 deletions.
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Bootstrap v4.x Extension for [jQuery Validation Unobtrusive](https://github.com/aspnet/jquery-validation-unobtrusive)
================================

This library is a extension for [jQuery Validation Unobtrusive](https://github.com/aspnet/jquery-validation-unobtrusive) and [jQuery Validation](https://github.com/jquery-validation/jquery-validation). It ensures the full compatibility between Bootstrap v4.x and jQuery Validation in interaction with ASP.NET MVC Core.

## License
Copyright &copy; Bremus Solutions<br>
Licensed under the MIT license.
36 changes: 36 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"name": "jquery-validation-unobtrusive-bootstrap",
"description": "jQuery Unobtrusive Validation for Bootstrap v4.x",
"version": "2.0.0",
"license": "MIT",
"main": "dist/unobtrusive-bootstrap.js",
"homepage": "https://www.brecons.net/",
"authors": [
"Timm Bremus <[email protected]>"
],
"keywords": [
"jquery",
"asp.net",
"mvc",
"validation",
"unobtrusive",
"bootstrap"
],
"ignore": [
"source",
"spec",
".bowerrc",
".gitignore",
".jshintignore",
".jshintrc",
"bower.json",
"gruntfile.js",
"package.json",
"README.md"
],
"dependencies": {
"jquery": "3.2.1",
"jquery-validation": "1.17.0",
"jquery-validation-unobtrusive": "3.2.6"
}
}
23 changes: 23 additions & 0 deletions dist/unobtrusive-bootstrap.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
(function ($) {
var defaultOptions = {
validClass: 'is-valid',
errorClass: 'is-invalid',
highlight: function (element, errorClass, validClass) {
$(element)
.removeClass(validClass)
.addClass(errorClass);
},
unhighlight: function (element, errorClass, validClass) {
$(element)
.removeClass(errorClass)
.addClass(validClass);
}
};

$.validator.setDefaults(defaultOptions);

$.validator.unobtrusive.options = {
errorClass: defaultOptions.errorClass,
validClass: defaultOptions.validClass,
};
})(jQuery);

0 comments on commit d77441a

Please sign in to comment.