-
Hi,
for some reason, I can't add another option to my combo box. I have:
sub init()
oOption = document.createElement("OPTIONS")
oOption.text="Apples"
oOption.value="5"
FontName.options.add(oOption)
end sub
Where fontname is the name of the combo box and I want to add lets say "apples" to my list. I need to use VBScript BTW so I can use my activeX controls which need to interact with it. Anyone know what I'm doing wrong? thanks!
-
this should help you.
Code:
<BODY><HEAD>
<script Language="VBScript">
dim i
sub ShowDetails()
i = i + 1
dim oOption
set oOption = document.createElement("OPTION")
oOption.text="Apples"
oOption.value=i
document.frm1.select1.add(oOption)
end sub
</script>
</head>
<form name="frm1">
<SELECT id=select1 name=select1 size=2 style="HEIGHT: 134px; WIDTH: 258px">
</SELECT>
</form>
<input type="button" onclick="ShowDetails()" value="Click">
</BODY></HTML>