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

Acces to TD in array on html document ?

Moi
Hi,

I have a 'small' problem for read and write something in TD cell

i try this:

d = window.document;

eTBL = d.getElementById('tbCal');
cTR = eTBL.getElementsByTagName('td');

cTD = new Array(); // Collection des TD ligne par ligne
for (i = 0; i < cTR.length; i++){
cTD[i] = cTR[i].getElementsByTagName('td');
alert("une cellule");
}

but if eTBL is correct...... cTR.length = 0

why this $%*#@ of value is 0???? my array have 8 lines with 7 cell for each,
but the first line have only 3 cell
HELP Please !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Jul 20 '05 #1
2 3274

"Moi" <mo*@moi.com> wrote in message
news:bj*********@news-reader1.wanadoo.fr...
| Hi,
|
| I have a 'small' problem for read and write something in TD cell
|
| i try this:
|
| d = window.document;
|
| eTBL = d.getElementById('tbCal');
| cTR = eTBL.getElementsByTagName('td');
|
| cTD = new Array(); // Collection des TD ligne par ligne
| for (i = 0; i < cTR.length; i++){
| cTD[i] = cTR[i].getElementsByTagName('td');
| alert("une cellule");
| }
|
| but if eTBL is correct...... cTR.length = 0
|
| why this $%*#@ of value is 0???? my array have 8 lines with 7 cell for
each,
| but the first line have only 3 cell

Where's the rest of the page?

|
|
| HELP Please !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
|
|
Jul 20 '05 #2
"Moi" <mo*@moi.com> wrote in message
news:bj*********@news-reader1.wanadoo.fr...
Hi,

I have a 'small' problem for read and write something in TD cell

i try this:

d = window.document;

eTBL = d.getElementById('tbCal');
cTR = eTBL.getElementsByTagName('td');
Shouldn't be cTR = eTBL.getElementsByTagName('tr'); ?

^^^

cTD = new Array(); // Collection des TD ligne par ligne
for (i = 0; i < cTR.length; i++){
cTD[i] = cTR[i].getElementsByTagName('td');
alert("une cellule");
}

but if eTBL is correct...... cTR.length = 0

why this $%*#@ of value is 0???? my array have 8 lines with 7 cell for each, but the first line have only 3 cell
HELP Please !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Jul 20 '05 #3

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

Similar topics

5
by: F. Da Costa | last post by:
Hi, Could it be correct that the following code does *not* work because i'm not using the var arr = new Array("a","b","c"); methodology?? Read through...
2
by: Himaxda0 | last post by:
Is it possible to access Objects like (document.form1.textfield1) with a string variable like (var obName='textfield1') and using (document.form1.obName.value)? Ive tried it in IE but the value in...
29
by: Hagen | last post by:
Hello, in a recent thread "speed of vector vs array" I read about the problem of the slow acces by addressing vector elements by indexing, unfortunately I see no workaround in my case. My...
4
by: Mark Hannon | last post by:
I am trying to initialize an array only once so it can be seen & used by any functions that need it. As I understand it, if a variable is declared by itself outside of any functions, its scope is...
1
by: Jenny | last post by:
Hi, Can I create an array of tags by assigning same name to these tags? For example, I have two <p> tags with the same name t1. But document.all.b.value=document.all.t.length does not...
21
by: yeti349 | last post by:
Hi, I'm using the following code to retrieve data from an xml file and populate a javascript array. The data is then displayed in html table form. I would like to then be able to sort by each...
3
by: Newcomsas | last post by:
Hello, I'm trying to solve a problem with JS textbox array without success. I have two buttons in my page: PLUS and MINUS; at every click on PLUS a new textbox named 'dear' is generated. So, if...
4
by: mflll | last post by:
I am looking into the different techniques of handling arrays of edit boxes in Java Script. The first program below works fine. However, are there better ways of doing this, where the person...
2
by: stealth_spoof | last post by:
Hi People wondering if anyone can help me with a problem I'm having I'm trying to create an array with an unspecified length, the length is based on the result i get from another task in the code...
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: 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: 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: 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?
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
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,...

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.