<SCRIPT LANGUAGE="JavaScript">
function addRow(){
// Get a reference to the table
var tableRef = document.getElementById('orderdetail');
var lastRow = tableRef.rows.length;
var iteration = lastRow;
var row= tableRef.insertRow(lastRow);
// Insert a row in the table at row index 0
var cell1 = row.insertCell(0);
var el1 = document.createElement('input');
el1.type = 'text';
el1.name = 'item_no_' + iteration;
el1.id = 'item_no' + iteration;
el1.size = 10;
cell1.appendChild(el1);
}
</SCRIPT>
<form name="orderhead" action="CreateOrder2.jsp" method="post">
<table>
<tr>
<td>Po Number<input type ="text" name="po_no"></td>
<td>Date <input type="text" name="po_date"></td>
<tr>
</table>
<table id="orderdetail">
<tr>
<td><input type ="text" name="item_no_0" size="10"></td>
</tr>
</table>
<input type="button" value="Add row" onclick="addRow();">
<input type="submit" value="Save">
</form>
it is possible to get item_no_0(first row) from the form using request.getParameter. But i am not able to get the other rows from the form using request.getParameter. The other rows are created using the javascript. how to get the values from the script. I am using a loop to get all the parameters. but, i am getting null values except for the first row
Also, how to find the number of rows add in the "orderdetail" table.