I've got an HTML "select" element which I'm updating dynamically with code something like this:
var selector = document.getElementById('selectorId');
for (var i = 0; i < data.length; ++i)
{
var opt = document.createElement('option');
opt.value = data[i].id;
opt.text = data[i].name;
selector.appendChild(opt);
}
Works fine in Firefox, but IE7 doesn't resize the list box to fit the new data. If the list box is initially empty (which it is in my case), you can hardly see any of the options I've added. Is there a better way to do this? Or a way to patch it up to work in IE?