Net validating checkbox

Posted by / 19-Sep-2020 04:06

Net validating checkbox

allows the user to select more than one item from the group.

In some cases you may want to use multiple check boxes to make some selections.

If i un check it and click on the button the same confirm message is getting displayed instead of alert box.

But of course I didn't want the user to see the dummy text box. When I did that, the validation method was never called. NET does not perform validation for a control whose visibility is false.

The solution was to hide it by setting its "display" attribute to "none". To String(); // chk is the checkboxlist to validate txt Dummy.

It turned out that the validation does not work for Checkbox List.

I found the following article about it: claims that there are 3 possible solutions: implement the validation not using the validation controls, use custom validation controls and write the validation methods, or create a custom control that does the validation the same way as the validation controls provided by the ASP. Since the third option is out of my scope for this project, I chose the second option, using the custom validation control.

net validating checkbox-30net validating checkbox-8net validating checkbox-51

As a example you may need to select preferred subjects of a student(Maths, Science, English etc.).