I have looked everywhere I can for a solution to this problem but
nothing so far has worked.
I have two list boxes in my form. The first one (selAvailable) is
populated from an access database. The second (selSelected) is
populated by selecting items in selAvailable and clicking the add
button. In some situations there can be hundreds or thousands of items
in the selAvailable list box. If a user selects a few hundred or
clicks the Add All button the selSelected list box will begin to
populate until the whole page freezes then crashes.
I tried making the list box selSelected invisible before added items
to it but that did not help.
I know it seems that no user would ever want to have a list box with
so many items but in the context of my webpage it is needed.
Below is the Add All code that adds all of the items from the
selAvailable list box to the selSelected list box. I greatly
appreciate anyones help, thank you very much in advance.
~Julia
function AllAdd()
{
var i
var count
var selectedText
var selectedValue
var selAvailableLength = frmSelect.selAvailable.length
var selSelectedLength = frmSelect.selSelected.length
var newoption
var count = selSelectedLength + 0;
for (i = 0; i < selAvailableLength; i++)
{
selectedText = frmSelect.selAvailable.options[i].text;
selectedValue = frmSelect.selAvailable.options[i].value;
newoption = new Option(selectedText, selectedValue, false, false);
frmSelect.selSelected.options[count] = newoption;
count = count + 1;
frmSelect.selAvailable.options[i] = null;
selAvailableLength = frmSelect.selAvailable.length;
i--;
}
}