By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,306 Members | 1,657 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,306 IT Pros & Developers. It's quick & easy.

Disable RequiredFieldValidator with Javascript?

P: n/a
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
Nov 19 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
dhnriverside schrieb:
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
Nov 19 '05 #2

P: n/a
There is a ValidatorEnable function in the Asp.net javacsript Script
Library,that can enable disable individual validators ..

Nov 19 '05 #3

P: n/a
Hi Jan

I'd rather not on this budget :)

Anyone know how to do this?

"Jan Peter Stotz" wrote:
dhnriverside schrieb:
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

Nov 19 '05 #4

P: n/a

Found it well documented here , pls look for 'Client-Side APIs' section

http://msdn.microsoft.com/library/de...pplusvalid.asp

Nov 19 '05 #5

P: n/a
Brilliant peice of information. Sorted - thank you!

"sr**********@gmail.com" wrote:

Found it well documented here , pls look for 'Client-Side APIs' section

http://msdn.microsoft.com/library/de...pplusvalid.asp

Nov 19 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.