I have create a dynamic html table by adding some rows where I have to put
some value in an input field and now how can I get all value of all row ???
I try this but it doesn' work
button onclik=Alert("E ditFieldValue2. value");
Please reply me as soon as possible.
<script>
function addRowToTable()
{
var FieldArray=new Array("ID","Cod iceArticolo","L td");
var tbl = document.getEle mentById('Searc hTable');
var lastRow = tbl.rows.length ;
// if there's no header row in the table, then iteration = lastRow + 1
var iteration = lastRow;
var row = tbl.insertRow(l astRow);
// numero progressivo
var cellFirst = row.insertCell( 0);
var textNode = document.create TextNode(iterat ion);
cellFirst.appen dChild(textNode );
// edit per il valore da ricercare sul campo
var cellOne = row.insertCell( 1);
var el = document.create Element("input" );
el.setAttribute ('type', 'text');
el.setAttribute ('size', '40');
el.setAttribute ('name', 'EditFieldValue ' + iteration);
cellOne.appendC hild(el);
}
function removeRowFromTa ble()
{
var tbl = document.getEle mentById('Searc hTable');
var lastRow = tbl.rows.length ;
if (lastRow > 2) tbl.deleteRow(l astRow - 1);
}
function openInNewWindow (frm)
{
// open a blank window
var aWindow = window.open("", "TableAddRowNew Window",
'scrollbars=yes ,menubar=yes,re sizable=yes,too lbar=no,width=4 00,height=400') ;
// set the target to the blank window
frm.target = "TableAddRowNew Window";
// submit
frm.submit();
}
</script>
<form action="tablead drow_nw.html" method="get">
<input type="button" value="Add" onclick="addRow ToTable();" />
<input type="button" value="Remove" onclick="remove RowFromTable(); " />
<input type="button" value="Submit" onclick="openIn NewWindow(this. form);" />
<table border="1" id="SearchTable ">
<tr>
<th colspan="5">Sam ple table</th>
</tr>
<tr>
<td>1</td>
<td><input type="text" name="EditField Value1" size="40" /></td>
</tr>
</table>
</form>