Problem with dynamic addition of rows

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • aashishn86
    New Member
    • Mar 2009
    • 51

    Problem with dynamic addition of rows

    i am using this function to add rows dynamically

    Code:
    function addRow()
    {
      var tbl = document.getElementById('applications');
      var lastRow = tbl.rows.length;
      // if there's no header row in the table, then iteration = lastRow + 1
      var iteration = lastRow;
      var row = tbl.insertRow(lastRow);
      
      // left cell
      var cellLeft = row.insertCell(0);
      var el = document.createElement('input');
      el.type = 'text';
      el.name = 'txtRow' + iteration;
      el.id = 'txtRow' + iteration;
      el.size = 45;
      //e1.style.color='blue'
     // e1.className="cellData";
      //e1.style.width="220px";
      //e1.maxlength=20;
      //alert("hi")
    
      //e1.style.height=17px;
       cellLeft.appendChild(el);
    }
    when i try to use these :
    Code:
    //e1.style.color='blue'
     // e1.className="cellData";
      //e1.style.width="220px";
      //e1.maxlength=20;
     //e1.style.height=17px;
    it stops working...

    can some one guide me..
    i really need to add styles etc to the rows added
    Last edited by Dormilich; Jul 8 '09, 04:36 AM. Reason: wEll rEaDaBle tItleS mAkE yOu lOOk moRE pROfeSSIoNal
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    "e1" is not "el" (though they look very similar in Courier fonts)

    Comment

    • aashishn86
      New Member
      • Mar 2009
      • 51

      #3
      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 :)

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        Try the Dynarch calendar.

        Comment

        Working...