954,568 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Problem in naming the cloned rows

Hi friends,

I am java programmer .I am doing one simple job in javascript.i totally struck with this code for last two days..
Pleas help me to sort out.

My problem is i cloned row in the table each row contains two select button and three text box.I want to change the names of the select and input boxes.

var counter = 0;
var rowNum =0;
function addRowToTable()
{
  counter++;
  
   tabBody = document.getElementById('tblSample').firstChild;
   newRow = tabBody.appendChild(tabBody.firstChild.nextSibling.cloneNode(true));
   rowNum = rowNum + 1;
   for (i = 0; i < newRow.cells.length; i++) 
              newRow.cells[i].name = theName + counter;
   }


please help me

priya

priyapratheep
Newbie Poster
6 posts since Oct 2007
Reputation Points: 10
Solved Threads: 0
 

Do just a couple of things that may cause you code not to work. I hope you are closing
addRowToTable()? And also, what is theName?

sillyboy
Practically a Master Poster
686 posts since Mar 2007
Reputation Points: 85
Solved Threads: 64
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You