I have a multi-select listbox in a pop-up window that is populated with items from Active Directory.
On the CloseWindow event I want to load all the selected items into a textbox on the parent form.
It's working fine with the code below. But the problem is it is extremely slow because the listbox contains over 10,000 items and I am iterating over each item to determine if it is selected or not.
Is there a way to get the selected items without having to iterate through every item like I am doing here?
var i = 0;
selectedItems = "";
var selectedObj = document.getElementById('r_SecurityGroupList');
for(i=0; i<document.getElementById('r_SecurityGroupList').options.length; i++)
selectedItems += document.getElementById('r_SecurityGroupList').options[i].value + "; ";}}
selectedItems = selectedItems.slice(0,-1);
window.opener.document.getElementById('r_SecurityGroup').value += selectedItems;
Open in new window