Hi everybody,

I have a HTML Form, which contains a COMBOBOX ( <SELECT ID="...
...>...</SELECT> ).

I populate this COMBOBOX in VBscript by using the method .ADD like this
:

Set objOpt = document.CreateElement("OPTION")
objOpt.Value = "value"
objOpt.Text = "text"
myForm.MyCombo.add objOpt

this works fine, but I'd like to remove all elements of this COMBOBOX,
somebody could tell me how to do this ?

I've tried myForm.MyCombo.Items.Clear (I found it in the Web) but no
success.

Thanks for your help,
Vincent

Re: How to remove all elements in a combobox using VBscript by mayayana

mayayana
Tue Sep 12 08:46:25 CDT 2006

Combo.Options.Length = 0


> I have a HTML Form, which contains a COMBOBOX ( <SELECT ID="...
> ...>...</SELECT> ).
>
> I populate this COMBOBOX in VBscript by using the method .ADD like this
> :
>
> Set objOpt = document.CreateElement("OPTION")
> objOpt.Value = "value"
> objOpt.Text = "text"
> myForm.MyCombo.add objOpt
>
> this works fine, but I'd like to remove all elements of this COMBOBOX,
> somebody could tell me how to do this ?
>
> I've tried myForm.MyCombo.Items.Clear (I found it in the Web) but no
> success.
>
> Thanks for your help,
> Vincent
>