Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Set a drop down to a certain selection

0 views
Skip to first unread message

XP

unread,
May 16, 2008, 11:26:02 AM5/16/08
to
I need to set the selection in a drop down box (not a combo) to a certain
selection based upon a value in a variable:

dropdown1.Value = myVar

doesn't work; what is the correct syntax to set the selector?

Thanks much in advance.

Tom Lavedas

unread,
May 16, 2008, 1:18:21 PM5/16/08
to

What is the application? There are a lot of 'dropdowns' out there
with different object models. The HTML/DHTML Select object is one
such dropdown and it uses a 'selected' property to do what you
want ...

for each opt in dropdown.options
if lcase(opt.text) = lcase(myVar) then opt.selected = true
next

Other applications may use a different approach.

Tom Lavedas
===========
http://members.cox.net/tglbatch/wsh/

XP

unread,
May 16, 2008, 2:02:01 PM5/16/08
to
Hi Tom,

Sorry, it is in an HTA, and your solution works perfectly, thanks!

0 new messages