473,387 Members | 1,545 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,387 software developers and data experts.

ValidatorEnable doesn't?

Hi,

I have a couple websites that use the

ValidatorEnable(CompareValidator1, false)

to disable the validator from firing on testing some conditions in js.

My latest site is using masterpages so getting the control name is a little
more complex since it gets it's name mangled. None the less - I can get the
control name using something like this:

ValidatorEnable({0}, false);

where {0} is defined as CompareValidator1.ClientID.

When I look at the script that is generated either with viewsource or using
the IDE script debugging - it gets assembled correctly:

ValidatorEnable(ctl00_ContentPlaceHolder1_CompareV alidator1, false);

The problem is that the Validator is not being disabled. Has anyone seen or
heard of a problem like this with ValidatorEnable function? I'm about a week
behind on my delivery of this release so any advice would be greatly
appreciated.

thanks!!
Bill


Mar 11 '06 #1
2 7372
The problem with your code is that you are passing the ClientID (instead of
the object referred to by the clientID) to the ValidatorEnable function. Try
this instead:
ValidatorEnable(document.getElementById("ctl00_Con tentPlaceHolder1_CompareValidator1"), false);

or if you know the order of the validators on your page then your can refer
to the valdiator by its ordinal number within the Page_Validators array, e.g.
ValidatorValidate(Page_Validators[0],false);
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Bill44077" wrote:
Hi,

I have a couple websites that use the

ValidatorEnable(CompareValidator1, false)

to disable the validator from firing on testing some conditions in js.

My latest site is using masterpages so getting the control name is a little
more complex since it gets it's name mangled. None the less - I can get the
control name using something like this:

ValidatorEnable({0}, false);

where {0} is defined as CompareValidator1.ClientID.

When I look at the script that is generated either with viewsource or using
the IDE script debugging - it gets assembled correctly:

ValidatorEnable(ctl00_ContentPlaceHolder1_CompareV alidator1, false);

The problem is that the Validator is not being disabled. Has anyone seen or
heard of a problem like this with ValidatorEnable function? I'm about a week
behind on my delivery of this release so any advice would be greatly
appreciated.

thanks!!
Bill

Mar 12 '06 #2
Thanks Phillip for the quick reply.. as soon as I read your email I thought
that this was probably the problem solution. I made the changes and I had the
same problem with the Validators. As it turns out, I found a different
solution to the problem (isn't that just often the case :).

Thanks Much!!

"Phillip Williams" wrote:
The problem with your code is that you are passing the ClientID (instead of
the object referred to by the clientID) to the ValidatorEnable function. Try
this instead:
ValidatorEnable(document.getElementById("ctl00_Con tentPlaceHolder1_CompareValidator1"), false);

or if you know the order of the validators on your page then your can refer
to the valdiator by its ordinal number within the Page_Validators array, e.g.
ValidatorValidate(Page_Validators[0],false);
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"Bill44077" wrote:
Hi,

I have a couple websites that use the

ValidatorEnable(CompareValidator1, false)

to disable the validator from firing on testing some conditions in js.

My latest site is using masterpages so getting the control name is a little
more complex since it gets it's name mangled. None the less - I can get the
control name using something like this:

ValidatorEnable({0}, false);

where {0} is defined as CompareValidator1.ClientID.

When I look at the script that is generated either with viewsource or using
the IDE script debugging - it gets assembled correctly:

ValidatorEnable(ctl00_ContentPlaceHolder1_CompareV alidator1, false);

The problem is that the Validator is not being disabled. Has anyone seen or
heard of a problem like this with ValidatorEnable function? I'm about a week
behind on my delivery of this release so any advice would be greatly
appreciated.

thanks!!
Bill

Mar 12 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: AnnMarie | last post by:
My JavaScript Form Validation doesn't work at all in Netscape, but it works fine in IE. I made some of the suggested changes which enabled it to work in IE. I couldn't make all the changes...
39
by: Mark Johnson | last post by:
It doesn't seem possible. But would the following also seem a violation of the general notions behind css? You have a DIV, say asociated with class, 'topdiv'. Inside of that you have an anchor...
3
by: BTHOMASinOHIO | last post by:
I am running through an almost completed Web App and thought I would run it through Netscape for that 5% of users and WOW, Netscape doesn't play nice with the app !!!! Among many formatting...
149
by: Christopher Benson-Manica | last post by:
(Followups set to comp.std.c. Apologies if the crosspost is unwelcome.) strchr() is to strrchr() as strstr() is to strrstr(), but strrstr() isn't part of the standard. Why not? --...
0
by: suraj raut via .NET 247 | last post by:
(Type your message here) -------------------------------- From: suraj raut I have two radio button. When I click on one radiobuttonvalidation should be false else true. I am using...
16
by: Dany | last post by:
Our web service was working fine until we installed .net Framework 1.1 service pack 1. Uninstalling SP1 is not an option because our largest customer says service packs marked as "critical" by...
0
by: danielclark | last post by:
Hello, Here's my scenario: I have a simple contact form set up where the user can choose how they wish to be contacted from a list of options presented in a Select box (DropDownList)....
39
by: alex | last post by:
I've converted a latin1 database I have to utf8. The process has been: # mysqldump -u root -p --default-character-set=latin1 -c --insert-ignore --skip-set-charset mydb mydb.sql # iconv -f...
38
by: tshad | last post by:
In VS 2008, why doesn't ToString require "()". If I have Option Strict On on why can I do both: selectedIndex.ToString() selectedIndex.ToString or sQuery =...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.