Disable RequiredFieldValidator with Javascript?

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
 
J

Jan Peter Stotz

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
 
S

sreejith.ram

There is a ValidatorEnable function in the Asp.net javacsript Script
Library,that can enable disable individual validators ..
 
Joined
Jun 6, 2007
Messages
1
Reaction score
0
Disabling RequiredFieldValidator in Javascript

Hi,

RequiredFieldValidator can be disabled in the javascriopt by using the code below:

<%=RequiredFieldValidator1.IsValid=true %>

The above code has to be written in the java script function, onclik of any button.

Happy Coding!

Cheers,
Ananthram Athmakur
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top