I would like to replace an InputBox with a dropdown box in a very simple
script asking for user input prior to processing it. This is not for a web
page, but to be used on XP machines. Anyone have any suggestions?

Thanks.

---John

Re: Dropdown Box in VBScript? by Ravi

Ravi
Thu Jun 08 13:23:23 CDT 2006

Have you explored HTA?
I think that will be a better solution. It is again a HTML page but
user will have the feel of an application than just a web page

- Ravi
John Shelly wrote:
> I would like to replace an InputBox with a dropdown box in a very simple
> script asking for user input prior to processing it. This is not for a web
> page, but to be used on XP machines. Anyone have any suggestions?
>
> Thanks.
>
> ---John


Re: Dropdown Box in VBScript? by mr_unreliable

mr_unreliable
Thu Jun 08 15:25:04 CDT 2006

This is a multi-part message in MIME format.
--------------040809030608050603080806
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit

John, the attached hta demonstrates the use of a dropdown
user interface.

cheers, jw
____________________________________________________________

You got questions? WE GOT ANSWERS!!! ..(but,
no guarantee the answers will be applicable to the questions)


John Shelly wrote:
> I would like to replace an InputBox with a dropdown box in a very simple
> script asking for user input prior to processing it. This is not for a web
> page, but to be used on XP machines. Anyone have any suggestions?
>
> Thanks.
>
> ---John

--------------040809030608050603080806
Content-Type: text/plain;
name="testSelectRunApp.hta.txt"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename="testSelectRunApp.hta.txt"

PGh0bWw+DQo8dGl0bGU+bXlIVEE8L3RpdGxlPg0KPCEtLSBodGEgZXhhbXBsZSBieSBNaWNo
YWVsIEhhcnJpcywNCiAgICAgICBwb3N0ZWQgb24gdmJTY3JpcHQgbmcsIDMxTWFyMDIgLS0+
DQo8aHRhOmFwcGxpY2F0aW9uIGlkPSJteUhUQSIgYXBwbGljYXRpb25uYW1lPSJteUhUQSIN
CiAgc2luZ2xlaW5zdGFuY2U9InllcyIgd2luZG93c3RhdGU9Im5vcm1hbCIgY2FwdGlvbj0i
eWVzIg0KICBzaG93aW50YXNrYmFyPSJ5ZXMiIHN5c21lbnU9InllcyIgc2Nyb2xsPSJubyIN
Ci8+DQo8c2NyaXB0IGxhbmd1YWdlPSJ2YnNjcmlwdCI+DQpzdWIgc2VsT25lX29uY2hhbmdl
KCkNCiAgaWYgbWUuc2VsZWN0ZWRJbmRleCA9IDAgdGhlbiBleGl0IHN1Yg0KICBzQ21kID0g
bWUub3B0aW9ucyhtZS5zZWxlY3RlZEluZGV4KS52YWx1ZQ0KICBzZXQgc2hlbGwgPSBjcmVh
dGVvYmplY3QoIndzY3JpcHQuc2hlbGwiKQ0KICBzaGVsbC5ydW4gc0NtZA0KZW5kIHN1Yg0K
PC9zY3JpcHQ+DQoNCjxib2R5Pg0KDQo8U0VMRUNUIGlkPSJzZWxPbmUiIHNpemU9IjEiIG5h
bWU9ImRyMSI+DQogIDxvcHRpb24gc2VsZWN0ZWQ+U2VsZWN0IEZyb20gTGlzdDwvb3B0aW9u
Pg0KICA8b3B0aW9uIHZhbHVlPSdub3RlcGFkLmV4ZSBjOlx0ZXN0LnR4dCc+UHJvZ3JhbSAx
PC9vcHRpb24+DQogIDxvcHRpb24gdmFsdWU9J3dvcmRwYWQuZXhlIGM6XHRlc3QudHh0Jz5Q
cm9ncmFtIDI8L29wdGlvbj4NCjwvU0VMRUNUPg0KDQo8L2JvZHk+DQo8L2h0bWw+
--------------040809030608050603080806--

Re: Dropdown Box in VBScript? by mayayana

mayayana
Thu Jun 08 18:20:51 CDT 2006



Also, in case you need it:

You can clear the dropdown by setting length to 0.

You can add items to the dropdown with:

Dim opt
Set Opt = document.createElement("OPTION")
Opt.text = "Text to show"
SelOne.add Opt
Set Opt = Nothing

With all of that you've get pretty much the full functionality
of a normal GUI dropdown.

> John, the attached hta demonstrates the use of a dropdown
> user interface.
>
> cheers, jw
> ____________________________________________________________
>
> You got questions? WE GOT ANSWERS!!! ..(but,
> no guarantee the answers will be applicable to the questions)
>
>
> John Shelly wrote:
> > I would like to replace an InputBox with a dropdown box in a very simple
> > script asking for user input prior to processing it. This is not for a
web
> > page, but to be used on XP machines. Anyone have any suggestions?
> >
> > Thanks.
> >
> > ---John
>


----------------------------------------------------------------------------
----


> <html>
> <title>myHTA</title>
> <!-- hta example by Michael Harris,
> posted on vbScript ng, 31Mar02 -->
> <hta:application id="myHTA" applicationname="myHTA"
> singleinstance="yes" windowstate="normal" caption="yes"
> showintaskbar="yes" sysmenu="yes" scroll="no"
> />
> <script language="vbscript">
> sub selOne_onchange()
> if me.selectedIndex = 0 then exit sub
> sCmd = me.options(me.selectedIndex).value
> set shell = createobject("wscript.shell")
> shell.run sCmd
> end sub
> </script>
>
> <body>
>
> <SELECT id="selOne" size="1" name="dr1">
> <option selected>Select From List</option>
> <option value='notepad.exe c:\test.txt'>Program 1</option>
> <option value='wordpad.exe c:\test.txt'>Program 2</option>
> </SELECT>
>
> </body>
> </html>