Hello evrybody…anyone can help me to solve my problem???This is my javascript to insert the new row.The problem is…. it will clone all my fields such as amount_perunit,quantity,and amount. so i cannot insert the new input in that fields.For example if i have already key in the input in the first row and then when I want to insert the new row….it will display the data that I just key-in in the first row.
<script type=”text/javascript”>
var limit=10;
function addRow(Frm){
var allRows = document.getElementById(‘tab’).getElementsByTagName(‘tr’);
if(allRows.length<=limit){
var lastRow = allRows[allRows.length-1];
var root = lastRow.parentNode;
[B]var newRow = root.appendChild(lastRow.cloneNode(true));
var numRow = newRow.length;
Frm.elements[‘amaun_seunit’][allRows.length – 2].value=””;
Frm.elements[‘quantity’][allRows.length – 2].value=””;
Frm.elements[‘amount’][allRows.length – 2].value=””;
//alert(“NumRow : ” + allRows.length);
}
else {
alert(‘Rows limited to ‘+limit);
}
}