Hi There,

I'm writing a script to dynamically fill a list box when the user tries to select it. The script works well with one problem, it closes the list again, when of course the user is expecting it to be open. Any ideas?

function FillList(List)
{
var TestItem = List.options.item(1);

if(TestItem.text == "List_Is_Empty") // If first time then we need to fill the list
{
var Temp = List.options.length;
for(var i=0; i<Temp; i++)
{
List.options.remove(0);
}

var NewOption = document.createElement("OPTION");
NewOption.text = "Ha ha 1";
NewOption.value = "1";

List.options.add(NewOption);

NewOption = document.createElement("OPTION");
NewOption.text = "Ha ha 2";
NewOption.value = "2";

List.options.add(NewOption);
List.click();
}
return true;
}

Dale