Is there any problem in this function?
It worked out pretty well till I decided to substitute the real name of the list with a var, cause I need to reuse the function for several lists...
It worked out pretty well till I decided to substitute the real name of the list with a var, cause I need to reuse the function for several lists...
Code:
function fillSubCat2(thelist,val1,val2){
document.forms['drop_list'].thelist.options.length = 0;
document.forms['drop_list'].thelist.options[0] = new Option(val2,val1);
}