Hi Guys,
I really hope someone can help me out here I have a php form that submits to a database which is all fine, a portion of the form allows for more rows to be added as needed but for some reason it only allows for upto 9 rows to be submitted then it just loops back through the first 9 and i have no idea why. Any help is greatly 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>