I am currently needing to validate that a checkbox list is a required field as well a number of text boxes on the page. I am using the .net RequireFieldValidator to do so but when choosing control to validate the checkbox list is not in the list of available controls. I have dont plenty of research to correct this issue and I keep seeing that I need to extend the validation class into a custom validator control. The project I am working on is throw away work due to an upcoming site rewrite. Is there a faster way of getting this same validation to occur still using the RequiredFieldValidator.
I am currently updating a textbox that has a border of 0 and forecolor set to white so it is basically hidden without it being hidden since once you hide the textbox the validator no longer works with the SelectedIndex.ToString() of my checkbox list and then validating that textbox as required instead of the checkbox string.
This seems a really round about way of doing it and cause a postback every time a checkbox is checked or unchecked and quite frankly is a complete hack to get it to work.
Any help would be great?
Instead of extending the validation class into a custom validator control. You can use the asp.net custom validator control (asp:CustomValidator). This link might be able to help you out.