From - Sat Jun 14 22:26:45 1997
Path: world1.bellatlantic.net!out2.nntp.cais.net!news2.cais.com!news.intr.net!news.charm.net!news-dc-10.sprintlink.net!news-dc-2.sprintlink.net!news-east.sprintlink.net!news-dc-26.sprintlink.net!news-peer.sprintlink.net!news.sprintlink.net!Sprint!cpk-news-hub1.bbnplanet.com!news.bbnplanet.com!newsfeed.internetmci.com!news.sgi.com!news.tamu.edu!news.utdallas.edu!nrchh45.rich.nt.com!bcarh8ac.bnr.ca!nbdchc4.bnr.ca!news
From: Denis Rondeau <Denis_Rondeau@nortel.ca>
Newsgroups: comp.lang.javascript
Subject: Re: Help: How to add new option in <select> object in MS IE
Date: Sat, 31 May 1997 02:02:36 -0400
Organization: Northern Telecom
Lines: 53
Message-ID: <338FBEFC.A19@nortel.ca>
References: <01bc6d42$8efc4da0$ec926dce@tasman.tsboffshore.com>
NNTP-Posting-Host: 47.85.162.164
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 3.0 (X11; I; HP-UX A.09.05 9000/720)
To: Tasman Chan <tasman@tstoffshore.com>

Tasman Chan wrote:
> 
> Hi there,
> 
>   I have 10 drop down boxes, they all show the same 150 options.  I want to
> save download time, so, is there a way to make these 10 drop down boxes to
> share the same options?
> 
>   I was trying to use "add new option" javascript to fill the boxes, it
> worked in Netscape, but not in MS IE.  Is there a way to add new option to
> a <select> object in MSIE?  Thankz!
> 
> Tasman :)

Try the following code.  It dynamically creates the drop-down boxes. 
Since this is done by the client application, download/network time is
minimized:

<script>
function do_title(n)
{
	// Choose whatever title you want...
	var title = "Select Box#" + n;
	document.write(title);
}

function do_options()
{
	document.write("	<option value=1> Text1");
	document.write("	<option value=2> Text2");
	document.write("	<option value=3> Text3");
}

document.write("<form name=formname>");
for (i = 1; i <= 10; i++) {
	document.write("<br>");
	do_title(i);
	document.write("<select name=select" + i + ">");
	do_options();
	document.write("</select>");
}
document.write("</form>\n");
</script>


Of course, you'll want to use proper titles, options, etc...

NOTE: This works for Netscape 3 on HP-UX and Macintosh, as well as
Internet Explorer 3.01 on Macintosh.


Regards,
Denis.
