Problem in naming the cloned rows

Please support our JavaScript / DHTML / AJAX advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Reply

Join Date: Oct 2007
Posts: 6
Reputation: priyapratheep is an unknown quantity at this point 
Solved Threads: 0
priyapratheep priyapratheep is offline Offline
Newbie Poster

Problem in naming the cloned rows

 
0
  #1
Oct 21st, 2007
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.
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. var counter = 0;
  2. var rowNum =0;
  3. function addRowToTable()
  4. {
  5. counter++;
  6.  
  7. tabBody = document.getElementById('tblSample').firstChild;
  8. newRow = tabBody.appendChild(tabBody.firstChild.nextSibling.cloneNode(true));
  9. rowNum = rowNum + 1;
  10. for (i = 0; i < newRow.cells.length; i++)
  11. newRow.cells[i].name = theName + counter;
  12. }

please help me

priya
Reply With Quote Quick reply to this message  
Join Date: Mar 2007
Posts: 686
Reputation: sillyboy is on a distinguished road 
Solved Threads: 61
sillyboy's Avatar
sillyboy sillyboy is offline Offline
Practically a Master Poster

Re: Problem in naming the cloned rows

 
0
  #2
Oct 21st, 2007
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?
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC