hi,
firstly thank you for the reply i am giving the details below kindly check and advice
i am trying to add dynamic rows(html,using javascript) using the below code(for this in html i have created one row with the same fields and once user clicks add button i am calling this function) it works and i am able to create rows dynamically and also able to insert the data into the database(using IE only)(using JSP) but with any other browser i am able to add rows dynamically(in mozilla,chrome) but when i am saving data it is taking the first record only and not the remaining valuesfunction addRow(tableID) {
var table = document.getElementById(tableID);
var rowCount = table.rows.length;
var row = table.insertRow(rowCount);
var colCount = table.rows[0].cells.length;
for(var i=0; i
var newcell = row.insertCell(i);
newcell.innerHTML = table.rows[0].cells[i].innerHTML;
switch(newcell.childNodes[0].type) {
case "select-one"
newcell.childNodes[0].selectedIndex = 0;
break;
case "text"
newcell.childNodes[0].value = ""
break;
case "select-one"
newcell.childNodes[0].selectedIndex = 0;
break;
case "select-one"
{
newcell.childNodes[0].selectedIndex = 0;
}
break;
case "text":
newcell.childNodes[0].value = ""
break;
}
}
}
解决方案