mredkj.com logo

An update blog for mredkj.com

What's this blog about?

mredkj.com is an unfocused programmer resource from Matt, Eric, and Keith

This blog will keep you up to date with our latest site changes.

Friday, November 18, 2005

Reference Dynamic Rows

Table Basics - Reference Dynamic Rows

This JavaScript example demonstrates how to reference elements in the cells of a table, including one preexisting row and rows that are dynamically generated.

posted by Keith [11/18/2005 12:56:00 AM] - permalink - 7 comments

7 comment(s):

Anonymous Anonymous wrote:

Hi there,
how to get all the Cell value, not just the last one??

Posted [12/11/2005 04:01:00 AM]  

Blogger Keith wrote:

To get all the cells, you'd loop it like in the following code, which is based on function getCells. I'm just providing this as a simple example.

var lastRow = tbl.rows.length - 1;
var a='', b='', c='';
for (var i=1; i<=lastRow; i++) {
a += tbl.rows[i].cells[0].innerHTML + ' ';
b += tbl.rows[i].cells[1].firstChild.value + ' ';
c += tbl.rows[i].cells[2].firstChild[tbl.rows[i].cells[2].firstChild.selectedIndex].text + ' ';
}

Posted [12/11/2005 02:43:00 PM]  

Anonymous Anonymous wrote:

how can i perform some action on table in html with javascript
plz be fast

Posted [3/01/2006 02:02:00 AM]  

Anonymous Anonymous wrote:

make the selected value visible after submit on the same page in html with java script

Posted [3/01/2006 02:04:00 AM]  

Blogger Keith wrote:

savita said...
"how can i perform some action on table in html with javascript
plz be fast"

Anonymous said...
"make the selected value visible after submit on the same page in html with java script"

I'm not sure I understand the question. If you're submitting the page to your server, then you'll need to use PHP or another server-side language to show the submitted value.

Also, I'm not always able to respond to questions immediately. You might want to try asking your question at webdeveloper.com

Posted [3/01/2006 08:52:00 AM]  

Anonymous Anonymous wrote:

Hi,
How can I replace the textbox with a textarea?

Do anybody can solve this?

Posted [4/14/2006 09:38:00 AM]  

Blogger Keith wrote:

Anonymous said...
How can I replace the textbox with a textarea?

Seems like your the same person who commented over in the Table Add Row entry. Refer over there for my response.

Posted [4/14/2006 06:42:00 PM]  

Post a Comment