Understanding the $.validator.unobtrusive.adapters.addBool() method Understanding the $.validator.unobtrusive.adapters.addBool() method jquery jquery

Understanding the $.validator.unobtrusive.adapters.addBool() method


Besides the article @BlueChippy linked to in the comments, I found the answer to 2. in this article.

  1. yes that's the only thing needed besides the attribute. That is because we use a rule that already exists (required).
  2. What does it do?

This just registers a new validation adapter for the MandatoryAttribute, where the first parameter is the adapter name and the second parameter is the name of jQuery validate rule. The adapter name should match the value we specified earlier as the validation type, and the jQuery validation required-rule will require the user to check the checkbox.

3 . More information can be found in this article on Brad Wilson's blog.