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

How to get the list of validators for a control.

Raj

Is it possible to get the list of all the validators that are attached to a
control ( for example Textbox) using client side javascript.

Thanks.

Nov 18 '05 #1
1 1010
Yes, client-side validators are acutally <span tags so you should be able to
do something like:

var spans = document.getElementsByTagName("span");
for (var i = 0; i < spans.length; ++i){
var span = spans[i];
var controlToValidate = span.exclude ||
span.getAttribute('controltovalidate');
if (controlToValidate != null && controlToValidate ==
'<%=TEXTBOXNAME.ClientId%>'){
alert(span);
}
}

span will them be a DOM object which points to a valiadator for TEXTBOXNAME
Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/
"Raj" <Ra*@discussions.microsoft.com> wrote in message
news:1E**********************************@microsof t.com...

Is it possible to get the list of all the validators that are attached to a control ( for example Textbox) using client side javascript.

Thanks.

Nov 18 '05 #2

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

Similar topics

4
by: Sean | last post by:
I'm having the problem described in KB article 822734. You can see it at this URL: http://support.microsoft.com/default.aspx?scid=kb;en-us;822734 In the article it says I can get the fix by...
7
by: David Laub | last post by:
I have stumbled across various Netscape issues, none of which appear to be solvable by tweaking the clientTarget or targetSchema properties. At this point, I'm not even interested in "solving"...
6
by: Mark | last post by:
We have Validators embedded in an asp table server control. The table server control is necessary and cannot be replaced. We want to apply CSS formatting to the validators, but the validators...
4
by: Dot net work | last post by:
If I have got 2 web user controls on my aspx form, and one web user control has got some validator controls on it, what I find is that if I enter in some "bad data" in to some text boxes on the...
4
by: Ian Cox | last post by:
I have a web form that contains a Datagrid. This grid has a number of columns, one of which contains a text box and validator for that text box. Everything works fine, when I press the "Save"...
1
by: epigram | last post by:
I'm trying to use the ASP.NET validators to check some client-side business rules. I've got two ASP TextBox controls (call them tbxYear1 and tbxYear2) used to enter a range of years. I've got a...
1
by: psparago | last post by:
I have developed a tab user control in which each tab is itself a user control and the tab selection control is a datalist. Each tabbed user control has zero or more validator controls on it. The...
1
by: Gabriel Lozano-Morán | last post by:
When using the tabstrip control combined with a multipage (several pageview) there is a problem when using validators. The problem is that validation also occurs on the validators that are not on...
3
by: rgparkins | last post by:
Hi I am currently having problems with Validators in a user control. I am creating a wizard sign-up process which have the allocated step (hyperlinks" at the top of the page. A user can also...
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
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
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...
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...

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.