-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
505c99a
commit d77441a
Showing
3 changed files
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 © Bremus Solutions<br> | ||
Licensed under the MIT license. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |