Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org

BBS: Re: Remove options from a Select object - July 19, 1998 at 19:33:57

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: {
: formname.selectname.options[k]=null;
: history.go (0);
: }

: For some reason, it doesn't work well. There always a few options left in the box.
: Does anyone know why? Thanks.

: Rachel


Follow-ups:

You are here: irt.org | BBS | Re: Remove options from a Select object [This BBS is closed]

©2018 Martin Webb