Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No documentation #158

Open
sunsande opened this issue Aug 19, 2022 · 4 comments
Open

No documentation #158

sunsande opened this issue Aug 19, 2022 · 4 comments

Comments

@sunsande
Copy link

This is the least documented project in history. There isn't a single line of documentation.

@ghost
Copy link

ghost commented Sep 2, 2022

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):
image

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!

@marklagendijk
Copy link

marklagendijk commented Sep 5, 2022

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-validation and jquery-validation-unobtrusive on 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.parse method:
    $.validator.unobtrusive.parse($('.myForm'));
  • How can you check for form validity in your custom submit handler?
    => You can ignore the submit event for non-valid forms by returning true at the top of the handler function:
    $('.myForm').on('submit', function(event){
      if(!$(this).valid()){
        return true;
      }
    
      // Your custom logic
    }

@shawnpaige
Copy link

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

@TanayParikh
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants