Validating checkboxlist

Rated 4.33/5 based on 632 customer reviews

Again for client side validation you could write a javascript function that uses the same logic mentioned above, however, what if you have other input controls which are validated using validation controls.You would loose consistency in displaying validation errors.

validating checkboxlist-86

validating checkboxlist-9

validating checkboxlist-14

In this method I just loop through all the items of the Check Box List and if I find one that is selected then I return true.I've tried to use Requiredfieldvalidator and Control To Validate but ASP. I'm not a Java Script guru so I did not implement or even thought about how to implement the client side validation.Now there can be other ways to achieve the same thing, for example, you could write a server code in code behind file and loop through checkbox list items and then check if any checkbox is checked or not.However posting a page back to server for such validation is not at desirable, hence a client side validation.

Leave a Reply