By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,758 Members | 1,247 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,758 IT Pros & Developers. It's quick & easy.

Problem with dynamic addition of rows

P: 52
i am using this function to add rows dynamically

Expand|Select|Wrap|Line Numbers
  1. function addRow()
  2. {
  3.   var tbl = document.getElementById('applications');
  4.   var lastRow = tbl.rows.length;
  5.   // if there's no header row in the table, then iteration = lastRow + 1
  6.   var iteration = lastRow;
  7.   var row = tbl.insertRow(lastRow);
  8.  
  9.   // left cell
  10.   var cellLeft = row.insertCell(0);
  11.   var el = document.createElement('input');
  12.   el.type = 'text';
  13.   el.name = 'txtRow' + iteration;
  14.   el.id = 'txtRow' + iteration;
  15.   el.size = 45;
  16.   //e1.style.color='blue'
  17.  // e1.className="cellData";
  18.   //e1.style.width="220px";
  19.   //e1.maxlength=20;
  20.   //alert("hi")
  21.  
  22.   //e1.style.height=17px;
  23.    cellLeft.appendChild(el);
  24. }
  25.  
  26.  
when i try to use these :
Expand|Select|Wrap|Line Numbers
  1. //e1.style.color='blue'
  2.  // e1.className="cellData";
  3.   //e1.style.width="220px";
  4.   //e1.maxlength=20;
  5.  //e1.style.height=17px;
  6.  
  7.  
it stops working...

can some one guide me..
i really need to add styles etc to the rows added
Jul 7 '09 #1
Share this Question
Share on Google+
3 Replies


Dormilich
Expert Mod 5K+
P: 8,639
"e1" is not "el" (though they look very similar in Courier fonts)
Jul 8 '09 #2

P: 52
whew... cool
thanks......... :)
another thing

How can i add a calendar control to this..
i need to add the anchor tag
and javascript functions to it..

thanks :)
Jul 8 '09 #3

acoder
Expert Mod 15k+
P: 16,027
Try the Dynarch calendar.
Jul 8 '09 #4

Post your reply

Sign in to post your reply or Sign up for a free account.