posted 14 years ago
Please refer the below code
function addRow()
{
var tbody = document.getElementById("table1").getElementsByTagName("tbody")[0];
var row = document.createElement("TR");
var cell1 = document.createElement("TD");
var cell2 = document.createElement("TD");
var cell3 = document.createElement("TD");
cell3.setAttribute("align","right");
var cell4 = document.createElement("TD");
cell4.setAttribute("align","right");
var cell5 = document.createElement("TD");
var cell6 = document.createElement("TD");
cell6.setAttribute("align","right");
var cell7 = document.createElement("TD");
var cell8 = document.createElement("TD");
var cell9 = document.createElement("TD");
var cell10 = document.createElement("TD");
cell1.innerHTML = "<td><input type=RADIO name=checkBoxTest onclick=modifynRemove(this,"+gRowId+"); ></td>";
cell2.innerHTML = "<td ><input type=text name= instrumentType"+gRowId+" readonly=true tabindex=-1 style=text-align:left;background-color:transparent value=\""+document.SAF_CallingForm.instrumentType.options[document.SAF_CallingForm.instrumentType.selectedIndex].text+"\" style=border:0><input type=hidden name= hdinstrumentType"+gRowId+" value="+document.SAF_CallingForm.instrumentType.options[document.SAF_CallingForm.instrumentType.selectedIndex].value+" ></td>" ;
cell3.innerHTML = "<td ><input type=text name= chequeDDDate"+gRowId+" readonly=true tabindex=-1 value=\""+document.SAF_CallingForm.chequeDDDate.value+"\" style=border:0;text-align:center;background-color:transparent></td>" ;
cell4.innerHTML = "<td ><input type=text name= amount"+gRowId+" readonly=true tabindex=-1 value=\""+document.SAF_CallingForm.amount.value+"\" style=border:0;text-align:right;background-color:transparent><input type=hidden name= hdAmount"+gRowId+" value="+document.SAF_CallingForm.amount.value+" ></td>" ;
cell5.innerHTML = "<td ><input type=text name= lbxcashAccount"+gRowId+" readonly=true tabindex=-1 value=\""+document.SAF_CallingForm.lbxcashAccount.value+"\" style=border:0;text-align:left;background-color:transparent></td>" ;
cell6.innerHTML = "<td ><input type=text name= chequeddno"+gRowId+" readonly=true tabindex=-1 style=text-align:right;background-color:transparent value=\""+document.SAF_CallingForm.chequeddno.value+"\" style=border:0></td>" ;
cell7.innerHTML = "<td ><input type=text name= infavourof"+gRowId+" readonly=true tabindex=-1 style=text-align:left;background-color:transparent value=\""+document.SAF_CallingForm.infavourof.value+"\" style=border:0></td>" ;
cell8.innerHTML = "<td ><input type=text name= payableat"+gRowId+" readonly=true tabindex=-1 style=text-align:left;background-color:transparent value=\""+document.SAF_CallingForm.showlbxpayableat.value+"\" style=border:0><input type=hidden name= hdpayableat"+gRowId+" value="+document.SAF_CallingForm.lbxpayableat.value+" ></td>" ;
cell9.innerHTML = "<td ><input type=text name= Drawnon"+gRowId+" readonly=true tabindex=-1 style=text-align:left;width:180px;background-color:transparent value=\""+document.SAF_CallingForm.showlbxDrawnon.value+"\" style=border:0><input type=hidden name= hdDrawnon"+gRowId+" value="+document.SAF_CallingForm.lbxDrawnon.value+" ></td>" ;
cell10.innerHTML = "<td ><input type=text name= reason"+gRowId+" readonly=true tabindex=-1 style=text-align:left;background-color:transparent value=\""+document.SAF_CallingForm.reason.value+"\" style=border:0></td>" ;
row.appendChild(cell1);
row.appendChild(cell2);
row.appendChild(cell3);
row.appendChild(cell4);
row.appendChild(cell5);
row.appendChild(cell6);
row.appendChild(cell7);
row.appendChild(cell8);
row.appendChild(cell9);
row.appendChild(cell10);
tbody.appendChild(row);
}