Split the requiredValidator into two validators. A boolean in .Net is always required, but can be set to false. To support validated but optional checkboxes we introduced the IsTrue validator.
- Required, to validate if a value is not
null
,undefined
or empty-string. - IsTrue, to validate a value (for example a checkbox) is set to true.
If you use the [Required]
or [RequiredAttribute]
ValidationAttribute for required checkboxes please create an IsTrueAttribute
based on ValidationAttribute