473,395 Members | 1,766 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,395 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 7373
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.