Hey Guys,
I have a form that allows for additional rows to be added based on the number of serials being entered however I have just noticed that it cuts off at 9 rows and starts to repost the first 9 rows again for anything past that and i can figure out whats going on and i really need to figure this out as soon as humanly possible.
Any help would be appreciated.
<script language="javascript">
//add a row to the rows collection and get a reference to the newly added row
var partsRowCount = 1; //stores the number of rows
//add a new row to the table
function addRow()
{
var namePrefix = "_" + (+partsRowCount + 1); //setup the prefix variable
partsRowCount++; //increment the counter
//add a row to the rows collection and get a reference to the newly added row
var newRow = document.all("orderentry").insertRow();
//add 3 cells (<td>) to the new row and set the innerHTML to contain text boxes
var oCell = newRow.insertCell();
oCell.innerHTML = "<input type='text' name='partid" + namePrefix + "'>";
oCell = newRow.insertCell();
oCell.innerHTML = "<input type='text' name='quantity" + namePrefix + "'>";
oCell = newRow.insertCell();
oCell.innerHTML = "<input type='text' name='desc" + namePrefix + "'>";
oCell = newRow.insertCell();
oCell.innerHTML = "<input type='text' name='serial" + namePrefix + "'>";
}
//deletes the specified row from the table
function removeRow(src)
{
/* src refers to the input button that was clicked.
to get a reference to the containing <tr> element,
get the parent of the parent (in this case case <tr>)
*/
var oRow = src.parentElement.parentElement;
//once the row reference is obtained, delete it passing in its rowIndex
document.all("orderentry").deleteRow(oRow.rowIndex);
}
</script>
<tr>
<td><input type="text" name="partid_1" id="partid_1" /></td>
<td><input type="text" name="quantity_1" id="quantity_1" /></td>
<td><input type="text" name="desc_1" id="desc_1" /></td>
<td><input type="text" name="serial_1" id="serial_1" /></td>
</tr>