i am making a table with dynamic increament of rows on click of button..!!
i have used an autocomplete textbox in a row...!!! which is based on textbox id..!!
.
.
as i know that id should be unique.. so how can i change ID then..?
function add(oRow)
{
var selObj = oRow.getElementsByTagName('select')[0];
if(selObj[0].selected){ // Check for empty ledger entry
alert("Please select ledger");
return false;
}
oRow.parentNode.replaceChild(oRow.cloneNode(true),oRow.parentNode.insertRow(oRow.rowIndex+1));
// alert(oRow.rowIndex+1);
var inpR = oRow.getElementsByTagName('input');
var inpN = oRow.nextSibling.getElementsByTagName('input');
var selR = oRow.getElementsByTagName('select')[0];
//alert(selR);
selR.disabled=true;
var selN = oRow.nextSibling.getElementsByTagName('select')[0];
selN.selectedIndex=0;
for(i=0;i<inpR.length;i++)
{
if(inpR[i].disabled){inpR[i].disabled=false;/**/};
if(inpR[i].type=='text'){inpR[i].disabled=true;inpN[i].value='';inpN[i].disabled=false};
if(inpR[i].value=='Add'){inpR[i].value='Edit';inpN[i].disabled=true};
} sumus();knockOut(selN);
}