Jump to content

GuardianZ

Members
  • Posts

    3
  • Joined

  • Last visited

Posts posted by GuardianZ

  1. this is the javascript function I used:

    function insertrow() {            var x=document.getElementById("maintable").insertRow(2);            x.bgColor="#C0C9D4";                        x.innerHTML="<td class='ns'><input type='button' onclick='insertrow()' value='+'/></td> \             	 <td>1</td> \             	 <td class='act'><textarea wrap='virtual' cols=28 rows=1 onchange='checksize(this)' onKeyUp='inc_lines(this)' name='act' type='text' id='text1'></textarea></td> \             	 <td class='in'><textarea wrap='virtual' cols=28 rows=1 onchange='checksize(this)'onKeyUp='inc_lines(this)'  name='in' id='inp'></textarea></td> \             	 <td class='ex'><textarea wrap='virtual' cols=28 rows=1 onchange='checksizethis)'onKeyUp='inc_lines(this)'  name='ex'id='er'></textarea></td> \             	 <td><input type='checkbox' /></td> \             	 <td><input id='fail' type='checkbox' onMouseUp='alertId2()'/></td> \             	 <td><input type='checkbox' /></td> \             	 <td class='com'><textarea wrap='virtual' cols=28 rows=1 onchange='checksize(this)'onKeyUp='inc_lines(this)' id='com' ></textarea></td> \             	 <td class='bi'><textarea wrap='virtual' cols=28 rows=1 onchange='checksize(this)'onKeyUp='inc_lines(this)'  name='bugid' id ='bi'></textarea></td></tr>";                                      }

    it is called with

    <td class="ns"><form><input type="button" onclick="insertrow()" value="+"/></form></td>

  2. I have written some code to insert a row to a table, but how do i:1) set the class="classname" for the <tr> for the new row 2) after the button is clicked to insert a new row I want the html to be updated to reflect the new row(s)..

×
×
  • Create New...