473,327 Members | 2,071 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Disable RequiredFieldValidator with Javascript?

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
5 6072
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
There is a ValidatorEnable function in the Asp.net javacsript Script
Library,that can enable disable individual validators ..

Nov 19 '05 #3
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

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

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

Nov 19 '05 #5
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Alphonse Giambrone | last post by:
I am trying to enable/disable a requiredfieldvalidator on the client side and am generating an error. I had found some documentation on validation which states that I should be able to...
6
by: BK | last post by:
I'm having a really strange problem with and HtmlSelect server control (listbox) and a RequiredFieldValidator that I am trying to use to make sure that someone has items in the listbox. The way...
2
by: techfuzz | last post by:
I scoured this group and others looking for the best way to disable a button after the first click to prevent multiple submissions, but never did find anything that worked like they said it would. ...
4
by: James Brett | last post by:
I have one form on the page but have multiple submit buttons for different elements. When clicking on a button not associated with the required elements the validator popup still comes up. How...
1
by: peshrad | last post by:
Hi ! I'm using Visual Studio .NET to program a Web application coding in C#. In my form I use an HtmlSelect control that calls a JavaScript function when the selected item changes. This...
2
by: Fluxray | last post by:
--Background: I have a webform including a datagrid. The datagrid is using template. Its ItemTemplate is used to display a look-up-table with labels. its EditItemTemplate is used to edit a row in...
2
by: ibiza | last post by:
Hi all, I have a quite big webform that has about ~15 validators. I found, after having looked at the generated HTML source, that the filesize is pretty big : about 65KB. Then, I added to every...
0
by: Bruce One | last post by:
I have noticed when we put a RequiredFieldValidator control, all functions associated with the control are not called at all..its like this RequiredFieldValidator started taking charge of...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.