jquery-validation-unobtrusive
jquery-validation-unobtrusive copied to clipboard
No documentation
This is the least documented project in history. There isn't a single line of documentation.
I came to the repo to find out what changed to make v4 - no docs.
For those in the same boat, I had to go digging in the pull requests (thankfully not too hard, but not ideal):

https://github.com/aspnet/jquery-validation-unobtrusive/pull/153/files
Still left having to assume that it was a breaking version because of the license changes. I could be wrong. No docs to tell me otherwise!
Sure, it is nice that this library is part of the default .NET setup etc, but when people actually visit this repo, they are usually looking for details. This repository currently still follows more the "it does what you want, trust me"-philosophy of .NET Framework, instead of the "you have full power and control"-philosophy of .NET Core.
Important details that are currently not documented (note: I answered most questions already, because I needed the answers and spend a couple of hours finding them):
- How is the library used and initialized?
=> By loading both
jquery-validationandjquery-validation-unobtrusiveon a page. - What does it do by default?
=> Client side validation messages, based on the
data-*validation attributes that are returned by .NET Core. - When / how does it run? =>?
- How should you activate it for dynamically loaded forms?
=> You can call the
$.validator.unobtrusive.parsemethod:$.validator.unobtrusive.parse($('.myForm')); - How can you check for form validity in your custom
submithandler? => You can ignore thesubmitevent for non-valid forms by returningtrueat the top of the handler function:$('.myForm').on('submit', function(event){ if(!$(this).valid()){ return true; } // Your custom logic }
It is also curious that the library went to v4, but the actual JS file used by the majority of consumers only has changes in the comments/license.
https://github.com/aspnet/jquery-validation-unobtrusive/pull/153/files#diff-7682608b44f7ec8d3e8ee99d54671b335ec57fd7cba3ff3eb4e8751234648820
Thanks for reaching out, this is technical debt we have within this repo. We're open to community contributions in this area to improve the documentation for this library.