prOblem wIth DynAmiC aDDition Of Rows !!

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

Join Date: Jun 2008
Posts: 185
Reputation: aashishn86 is an unknown quantity at this point 
Solved Threads: 9
aashishn86's Avatar
aashishn86 aashishn86 is offline Offline
Junior Poster

prOblem wIth DynAmiC aDDition Of Rows !!

 
0
  #1
Jul 7th, 2009
i am using this function to add rows dynamically

JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  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. }

when i try to use these :
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. //e1.style.color='blue'
  2. // e1.className="cellData";
  3. //e1.style.width="220px";
  4. //e1.maxlength=20;
  5. //e1.style.height=17px;

it stops working...

can some one guide me..
i really need to add styles etc to the rows added
rEaLITy iS aN iLLUSIOn cAUSED bY lACk oF aLCOHOL....
Reply With Quote Quick reply to this message  
Join Date: Apr 2009
Posts: 818
Reputation: Airshow is on a distinguished road 
Solved Threads: 116
Airshow's Avatar
Airshow Airshow is offline Offline
Practically a Posting Shark

Re: prOblem wIth DynAmiC aDDition Of Rows !!

 
0
  #2
Jul 8th, 2009
Aashishn86,

All the non-working statements contain typos.

Change e1. to el. all through.

Airshow
50% of the solution lies in accurately describing the problem!
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 185
Reputation: aashishn86 is an unknown quantity at this point 
Solved Threads: 9
aashishn86's Avatar
aashishn86 aashishn86 is offline Offline
Junior Poster

Re: prOblem wIth DynAmiC aDDition Of Rows !!

 
0
  #3
Jul 9th, 2009
ya thanks........
had figured that out......
they look so damn similar.....
rEaLITy iS aN iLLUSIOn cAUSED bY lACk oF aLCOHOL....
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