requiredvalidator for checkbox

  • Thread starter Thread starter SStory
  • Start date Start date
S

SStory

Is there no way to require a checkbox to be checked in ASP.NET?
The requiredvalidator control doesn't work for it--should I make a
server--roundtrip for that and check during the btn_click event? Is there
another way?

Thanks,
Shane
 
I've used a CustomValidator, and wrote some client side javascript to do
this type of check. That way you will avoid the roundtrip.

You could just as easily forgo the validators, and just write your own
routine for this, but I had some other validators on the page that were
being displayed in a validation summary, so it was more convenient.

"SStory >" <[email protected] <remove the 'online.' to send me
mail> wrote in message news:[email protected]...
 
custom validators do not require you to set that property. You can leave it
blank. Be sure to define a javascript function, and list it in the property
that speficies which client side function to run for the validation.

"SStory >" <[email protected] <remove the 'online.' to send me
mail> wrote in message news:[email protected]...
 
Back
Top