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

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?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.