You are here: irt.org | BBS | Re: Remove options from a Select object [This BBS is closed]
Posted by Dave on July 19, 1998 at 19:33:57:
In Reply to: Remove options from a Select object posted by Rachel on June 24, 1998 at 09:08:04:
What you need to do is
for (var k=0; k {
formname.selectname.options[k]=null;
}
history.go (0);
so the history.go (0) gets done after ALL the items have been
removed, not just the first one. Incidentally, you don't need the
history.go (0) for Netscape 4/IE4 as they remove items dynamically.
: I have a piece of Javascript code to remove options from a select box.
: for (var k=0; k : For some reason, it doesn't work well. There always a few options left in the box. : Rachel You are here: irt.org | BBS | Re: Remove options from a Select object [This BBS is closed]
: formname.selectname.options[k]=null;
: history.go (0);
: }
: Does anyone know why? Thanks.
Follow-ups: