0

the more i deep to javascript more i got confused..!!
.
.
i have put a autocomplete texbox in a row.. which have two more buttons Add/Remove..!!
.
.
With add u can append clone row under original row... and withy delete u can delete the row..!!!!
.
.
Problems when i add new row... which make clone of original row..!! which means that Id of autocomplete also get cloned...!!!!
.
.
Please help me out..!!! :(

my javascript code..!!

function add(oRow) 
{   oRow.parentNode.replaceChild(oRow.cloneNode(true),oRow.parentNode.insertRow(oRow.rowIndex+1));
 
        
    var inpR = oRow.getElementsByTagName('input');
    var inpN = oRow.nextSibling.getElementsByTagName('input'); 
    inpR[0].id = 'month_' + parseInt(oRow.rowIndex+2);
   iteration  = parseInt(oRow.rowIndex+2);
    
  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();
  var months =  new Array(<?= $imp_aUsers; ?>); 
$().ready(function() { 
    for(i=1;i<=iteration;i++)
    { 
    $("#month_"+i).autocomplete(months, {
        minChars: 0,
        max: 14,
        autoFill: true,
        mustMatch: true,
        matchContains: false,
        scrollHeight: 220,
        formatItem: function(data, i, total) {
            return data[0];
        }
    })};
    
});
}

Can anyone help..??? i know its hard to solve..>!! :D

1
Contributor
1
Reply
2
Views
7 Years
Discussion Span
Last Post by sam023
0

Some how i made it run on firefox... but IE showing this error..!!!
.
.
Can't move focus to the control because it is invisible, not enabled, or of type that does not accept focus

Can anyone help.?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.