How to validate checkbox list with data annotation
i use your code but when i use data annotation for validation then i notice no client side validation work. would you show how to validate checkbox list at client side with data annotation. discuss with sample code. thanks
Can someone please reply to this? I'm trying to use MVC Client side validation as well and it doesn't seem to work for this control as it won't emit the proper data-val-required tags for the checkboxes when the model property they are bound to has a "Required" Data Annotation.
Sorry for the late reply, I haven't checked the repo for quite a while. I'll post my reply here in case anyone has similar issues.
Client side validation using data annotations have rarely been very reliable due to the complexity of implementation. It was working fine for simple scenarios, I believe, but with time and many upgrades to ASP.NET it may not be relevant anymore. It's very unlikely it'll be fixed in any foreseeable future.
I would recommend looking into using frontend validation of generated checkbox lists possibly using JavaScript frontend validation e.g. jQuery Validation