944,044 Members | Top Members by Rank

Ad:
Oct 21st, 2007
0

Problem in naming the cloned rows

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
priyapratheep is offline Offline
6 posts
since Oct 2007
Oct 21st, 2007
0

Re: Problem in naming the cloned rows

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?
Reputation Points: 85
Solved Threads: 64
Practically a Master Poster
sillyboy is offline Offline
686 posts
since Mar 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in JavaScript / DHTML / AJAX Forum Timeline: preloading images
Next Thread in JavaScript / DHTML / AJAX Forum Timeline: Giving error message while exceeding fixed height textarea





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC