This works for the most part in IE. It creates new rows and deletes rows. Here are the problems:
1) the delete function doesn't delete the correct row intended.
2) Firefox does not work at all in terms of adding or deleting rows.
Here is the code thusfar:
Does anyone have a fix or know what I can do to get this to work? I have been trying different things and not getting it to work right.
I appreciate any assistance with this!
Rninja
1) the delete function doesn't delete the correct row intended.
2) Firefox does not work at all in terms of adding or deleting rows.
Here is the code thusfar:
Code:
<form name="form1" method="POST" action="script.php">
<input type="button" name="Button" value="Add Row" onClick="addRow()">
<table cellspacing="0" cellpadding="0" border="0" id="dynatable">
<thead>
<tr>
<td><strong>ID Number</strong></td>
<td><strong>Notes</strong></td>
</tr>
</thead>
<tbody id="TheBody">
<tr>
<td><input type="text" name="item1"></td>
<td><input name="notes1" type="text" size="75"></td>
</tr>
</tbody>
</table>
<input type="submit" name="Submit" value="Add Item(s)">
<input type="hidden" name="MM_insert" value="form1">
<input name="numberRows" type="hidden" id="numberRows" value="1">
</form>
<script language="JavaScript">
function addRow() {
var oRow;
var oCell1;
var oCell2;
var oCell3;
var newnumber;
newnumber = dynatable.rows.length;
oRow = dynatable.insertRow();
oCell1 = oRow.insertCell();
oCell1.innerHTML = "<input type='text' name='item" + newnumber + "'>";
oCell2 = oRow.insertCell();
oCell2.innerHTML = "<input name='notes" + newnumber + "' type='text' size='75'>";
oCell3 = oRow.insertCell();
oCell3.innerHTML = "<input type='button' name='Button2" + newnumber + "' value='remove Row' onClick='delRow()'>";
form1.numberRows.value++;
}
function delRow(){
oRow=dynatable.deleteRow();
}
</script>
Does anyone have a fix or know what I can do to get this to work? I have been trying different things and not getting it to work right.
I appreciate any assistance with this!
Rninja
