Click to See Complete Forum and Search --> : adding items to combo box


codefinger
April 15th, 2002, 07:43 AM
I want to dynamically add items to a dropdownlistbox (combobox) on my ASP
page, but the intellisense makes no sense to me (I thought this would be
simple -- maybe it is, but so am I...)

This code in the window's onload event:

ComboBox.Add "test"

returns a type mismatch error.

I thought perhaps I could use an ActiveX control for the dropdown instead,
but there is no combobox or dropdown box listed under the ActiveX section of
the toolbox in
VID, and I can't figure out where to browse for it.

I have uploaded the code to
http://www.bytesizedsystems.com/onlineCVC/electricCVC3.asp

Can anyone tell me what it is I am doing wrong?

Thanks in advance.

dinoshetty
May 9th, 2002, 01:36 AM
<%@ Language=VBScript %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<script language="javascript">
function f1(){
document.test.cb1.options[2]=new Option('hello',1)
}
</script>
<BODY onload="f1()">

<form name="test">
<select name=cb1>
<option>Test0</option>
<option>Test1</option>
</select>
</form>
</BODY>
</HTML>