guys, this code below will dynamically add new rows to the page
once the link is clicked..now, my problem is that how can i get the
value of the inputted rows..
<SCRIPT language="javascript">
function addRow(tableID) {
var table = document.getElementById(tableID);
var rowCount = table.rows.length;
var row = table.insertRow(rowCount);
var cell1 = row.insertCell(0);
var element1 = document.createElement("input");
element1.type = "checkbox";
cell1.appendChild(element1);
var cell2 = row.insertCell(1);
cell2.innerHTML = rowCount + 1;
var cell3 = row.insertCell(2);
var element2 = document.createElement("input");
element2.type = "text";
cell3.appendChild(element2);
var cell4 = row.insertCell(3);
var element3 = document.createElement("input");
element3.type = "radio";
cell4.appendChild(element3);
}
</SCRIPT>
</HEAD>
<BODY>
<TABLE id="dataTable" width="318" border="1">
<TR>
<TD width="34"><INPUT type="checkbox" name="chk1"/></TD>
<TD width="21"> 1 </TD>
<TD width="166"> <INPUT type="text" name = "txt1"/> </TD>
<TD width="69"><input type="radio" name="opt1" id="radio" value="radio"></TD>
</TR>
</TABLE>
<input type="button" value="Add Row" onClick="addRow('dataTable')" />
<p><a href="javascript:addRow('dataTable')"> add</a></p>
the attached picture will show you the generated output..