requiredvalidator for checkbox

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
 
M

Marina

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]...
 
M

Marina

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]...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top