Disable RequiredFieldValidator with Javascript?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi guys

Ok, I have a page with a couple of radio buttons. Next to the top one is a
test box, and next the bottom one is a Listbox.

The idea is that, depending which option is selected, you either type in the
box or select from the list. So, always one or other of the textbox/listbox
is disabled.

I'm handling the switching with javascript called when the radio buttons are
clicked.

Works fine. However, I've got a required field validator for the text box
and the listbox, and obviously I need to switch either one of those off as
well.

So, how can I disable the RequiredFieldValidator in Javascript?

Cheers


Dan
 
dhnriverside said:
The idea is that, depending which option is selected, you either type in the
box or select from the list. So, always one or other of the textbox/listbox
is disabled.

Works fine. However, I've got a required field validator for the text box
and the listbox, and obviously I need to switch either one of those off as
well.

So, how can I disable the RequiredFieldValidator in Javascript?

You may consider writing your own FieldValidator that is capable of
validating two controls and accepts the input data as valid if the data of
one control matches the requirements.

Jan
 
There is a ValidatorEnable function in the Asp.net javacsript Script
Library,that can enable disable individual validators ..
 
Back
Top