Home All Groups Group Topic Archive Search About

conditional RequiredFieldValidator

Author
11 Nov 2005 7:33 PM
Vi
Hi,
I have a TextBox control that needs to have a value only if a drop down box
on the same page has a certain value selected. Is it possible to achieve this
using RequiredFieldValidator for the TextBox and having EnableClientScript =
true (without a post)?

Or is it possible from client code to enable/disable the
RequiredFieldValidator ?

Thank you

Author
11 Nov 2005 10:51 PM
intrader
On Fri, 11 Nov 2005 11:33:58 -0800, Vi wrote:

> Hi,
> I have a TextBox control that needs to have a value only if a drop down box
> on the same page has a certain value selected. Is it possible to achieve this
> using RequiredFieldValidator for the TextBox and having EnableClientScript =
> true (without a post)?
>
> Or is it possible from client code to enable/disable the
> RequiredFieldValidator ?
>
> Thank you

I may be wrong in this answer, but in 1.1 you must use a CustomValidator
to achieve this effect. In 2.0 you can disable the validator.

I have seen code in http://www.peterblum.com/vam/valmain.aspx

by Peter Blum