You cannot implement this requirement by using in-built Data Annotations validation attributes. It is an abstract class with Is Valid virtual method.You will have to create custom validation to achieve this functionality. Is Valid method takes Value and Validation Context object as input parameters.While HTML5 form validation is typically about missing or invalid text inputs, there are other form element types that also require attention. Suppose you have a form on your website that at the bottom asks people to "accept the Terms and Conditions" or something similar.Basically you don't want the form to be submitted unless this is checked.
It can compare two values, for instance the values of two controls.
Abstract: j Query has a Validation plug-in which is full of features and is quite flexible. NET Master Pages presents interesting challenges in using this plug-in and I could not find a working solution on the net.
In this article, I will demonstrate how to use the j Query Validation plug-in with Master Pages . NET runtime modifies a Web Control’s Client ID, with each level of container prefixing its ID to the control, to ensure uniqueness.
Not the prettiest solution, but functional in all browsers with Java Script enabled.
Adding HTML5 validation to the checkbox is actually very simple.