473,395 Members | 1,706 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.

Count number of elements in a table row

Hai sir,

> in client validation am counting no of elements in a row from a table using

var num = list.childNodes[0].childNodes.length;

> is working good in IE7 but in firefox is not working

> here num(no of rows getting in IE7 is sum number) but in FireFox am getting number of rows is 0(Zero).
Jul 6 '07 #1
5 13273
Hai

> in client validation am counting no of rows in a table using

var num = list.childNodes[0].childNodes.length;

> is working good in IE7 but in firefox is not working

> here num(no of rows getting in IE7 is sum number) but in FireFox am getting number of rows is 0(Zero).

>at last am facing a problem at childNodes[ ] in FireFox

Thanks
Savindra
Jul 6 '07 #2
gits
5,390 Expert Mod 4TB
Hai sir,

> in client validation am counting no of elements in a row from a table using

var num = list.childNodes[0].childNodes.length;

> is working good in IE7 but in firefox is not working

> here num(no of rows getting in IE7 is sum number) but in FireFox am getting number of rows is 0(Zero).
hi ...

please post some code concerning this problem. show the javascript and html code to let us see what list is ...

kind regards
Jul 6 '07 #3
hi ...

please post some code concerning this problem. show the javascript and html code to let us see what list is ...

kind regards
This will work in IE but not in FireFox

In FireFox is mostly exit when it executes childNodes[ ]

<script language="JavaScript">
<!--
function isChecked()
{
var tableBody = document.getElementById('<%= CheckBoxList1.ClientID %>').childNodes[0];

//alert('tableBody.childNodes.length ' + tableBody.childNodes.length);

for (var i=0;i<tableBody.childNodes.length; i++)
{
//alert('#' + i + ' ' + tableBody.childNodes[i].childNodes.length);

for (var j=0;j<tableBody.childNodes[i].childNodes.length; j++)
{
var currentTd = tableBody.childNodes[i].childNodes[j];
var listControl = currentTd.childNodes[0];

alert('#' + i + ',' + j + ' checked? ' + listControl.checked);
}
}
}
// -->
</script>
Jul 6 '07 #4
gits
5,390 Expert Mod 4TB
Expand|Select|Wrap|Line Numbers
  1. var tableBody = document.getElementById('<%= CheckBoxList1.ClientID %>').childNodes[0]; 
  2.  
hi ...

please try to discover what tableBody is in case of IE and FF ... you may alert:

Expand|Select|Wrap|Line Numbers
  1. var tableBody = document.getElementById('<%= CheckBoxList1.ClientID %>');
  2. alert(tableBody.tagName);
i guess in FF you get thead and IE tbody ...

kind regards
Jul 6 '07 #5
acoder
16,027 Expert Mod 8TB
I have split the posts from the other threads. It's a different problem. I've also merged the posts into one thread. Keep all posts regarding this problem in this thread.
Jul 6 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: vic | last post by:
Hello, Dean Try this: select distinct c1, c2 into #tmp_1 from t1 select count(*) as cnt from #tmp_1 drop table #tmp_1 With best regards.
0
by: DataFreakFromUtah | last post by:
Hello! No question here, just a procedure for the archive. Search critera: count records imported count data imported count number of rows imported count number of records imported record import...
1
by: Henry Stockbridge | last post by:
Hi, I am doing database documentation and run the procedure below to list the record count for each table in the database. The results in the immediate window only a partial listing of tables. ...
1
by: tranky | last post by:
hi, only one information,please... how to count number of anonymous online users? I use ASP.NET 2.0 thank u tranky
29
by: n00m | last post by:
http://www.spoj.pl/problems/SUMFOUR/ 3 0 0 0 0 0 0 0 0 -1 -1 1 1 Answer for this input data is 33. My solution for the problem is...
5
by: isabelle | last post by:
hi, every body.. I have two program I couldn’t solve them So, can any body help me. please!! 1-Write a program that accepts a character and count number of occurrences in a file. The file...
11
by: Mack | last post by:
Hi all, I want to write a program to count number of bits set in a number. The condition is we should not loop through each bit to find whether its set or not. Thanks in advance, -Mukesh
2
by: mfaisalwarraich | last post by:
Hi Everybody, I am using the following code to get the recordset of an external database. Dim dbPatients As Database Dim rsCountPatients As Recordset ' to count number of...
5
by: jambonjamasb | last post by:
I am wanting to create a report that summarises the number of items within a date range. For example I have a FIELD called System_Change. This is a drop down COMBOBOX that uses words like unix,...
1
by: jlt206 | last post by:
This code <?php include("counter.php")?> on the webpage produces the count number. (function code below) I want to place the current number into a variable $MemberNo or into a FormField to be sent...
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:
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: 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
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
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.