HI,
I am using two listboxes in asp.net and i am using javascript for moving items from one list box to another but when i am trying to move all items from one listbox to another listbox then not all the items moves from one listbox to another but only some items removes and moves so can you give me suggestion for my problem... my code is given below....
[code=javascript]
if(id=="ctl00_C ontentPlaceHold er1_TabAddCompa ny_TabPanel1_bt nnextall")
{
var i = 0;
for (i = 0; i <= lstavailablesta te.length - 1; i++)
{
var newOption = new Option(); // Create a new instance of ListItem
newOption.text = lstavailablesta te.options[i].text;
newOption.value = lstavailablesta te.options[i].value;
lstassociatedst ate.options[i] = newOption; //Append the item in Target
hid = hid + lstavailablesta te.options[i].value + ",";
lstavailablesta te.remove(i); //Remove the item from Source
}
}
[/code]
awaiting for reply...
thanks in advance......
I am using two listboxes in asp.net and i am using javascript for moving items from one list box to another but when i am trying to move all items from one listbox to another listbox then not all the items moves from one listbox to another but only some items removes and moves so can you give me suggestion for my problem... my code is given below....
[code=javascript]
if(id=="ctl00_C ontentPlaceHold er1_TabAddCompa ny_TabPanel1_bt nnextall")
{
var i = 0;
for (i = 0; i <= lstavailablesta te.length - 1; i++)
{
var newOption = new Option(); // Create a new instance of ListItem
newOption.text = lstavailablesta te.options[i].text;
newOption.value = lstavailablesta te.options[i].value;
lstassociatedst ate.options[i] = newOption; //Append the item in Target
hid = hid + lstavailablesta te.options[i].value + ",";
lstavailablesta te.remove(i); //Remove the item from Source
}
}
[/code]
awaiting for reply...
thanks in advance......
Comment