Validating checkboxlist

Rated 4.70/5 based on 790 customer reviews

On the aspx file you can now work with the Validateable Check Box List just like you would with a plain Text Box.

validating checkboxlist-19

validating checkboxlist-66

I've got a Check Box List control that I want to require the user to check at least ONE box, it does not matter if they check every single one, or 3, or even just one.

It's easy to do this validation server side, but I am assuming you want to do it client side?

JQuery can do this very easily as long as you have something that all checkbox controls have in common to use as a selector such as class (Css Class on your . You can make a simple JQuery function and connect it to a ASP. Remember if you do go the custom validator route to make sure you check it server side as well in case javascript is not working, you don't get a free server side check like the other . For more information on custom validators check out the following links: net and MSDN You don't need to use JQuery, it just makes the javascript function to iterate and look at all your checkbox controls much easier but you can just use vanilla javascript if you like.

Nothing to install and it will be full supported in the next version of Visual Studio I think.

Don't know why but when the Check Box List is inside Update Panel and a partial post back is made..

Leave a Reply