Meggie
05-02-2003, 07:05 PM
Can someone please help ... Basically, in the function, I am trying to re-initialize the option list so that I can create another option list.
fruits is Select box.
These are the codes:
for(i=0;i <old_size; i++) {
form.fruits.options[i] = null; // [COLOR=orangered]this doesn't work somehow !!! :confused:
} //[COLOR=darkred]but if I do this, it'll work: form.fruits.options[1] = null; I mean if it's not a variable, then it'll work.
//the creation is working fine:
for(i=0;i<new_size; i++){
form.fruits.options[i] = new Option(value, value);
}
Thank you so much for your help.
fruits is Select box.
These are the codes:
for(i=0;i <old_size; i++) {
form.fruits.options[i] = null; // [COLOR=orangered]this doesn't work somehow !!! :confused:
} //[COLOR=darkred]but if I do this, it'll work: form.fruits.options[1] = null; I mean if it's not a variable, then it'll work.
//the creation is working fine:
for(i=0;i<new_size; i++){
form.fruits.options[i] = new Option(value, value);
}
Thank you so much for your help.