I've found the model annotations very useful for the validation in MVC but can't seem to get it working for a checkbox. I am using MVC 3 with razor and c#.
Thanks
I've found the model annotations very useful for the validation in MVC but can't seem to get it working for a checkbox. I am using MVC 3 with razor and c#.
Thanks
Last time I heard this question, the customer wanted to verify whether the question had been answered or not. This is not possible with a checkbox, and can only be done by using a pair of radio buttons for yes and no and defaulting both to unchecked. Then when submitted, if neither button is checked, validation fails.