I have this called by the onclick handler on a radio button group:
function loadContacts(myForm){
myForm.Contact.options.length= 0;
var gpList = getSelectedRadioValue(myForm.Group_Name);
var useList = new Array();
useList = makeArray(gpList);
//alert(useList[0][0]);
if (useList !== '') {
var x = useList.length;
for (x = 0; useList[x]; x++) {
myForm.Contact.options[x] = new Option(useList[x][0],
useList[x][1],false,false);
}
}
}
I runs fine on first use and a drop-down is list is filled with names
and their email address as a value. When I click a second radio button
(even the currently selected one) , the script fails at this line:
useList = makeArray(gpList); - saying 'function expected'. Why it worked
first time round. FWIW, there are no global vars in play.
I've tried setting useList = null at before quitting the function but it
should be destroyed as it goes out of scope when the function finishes.
Any ideas?
Regards
Mark