Can anyone help me?
I am attempting to take the selection from a DropDown box and write
that selection to a text file.
Any help would be greatly appreciated.

Thanks,
Cisco

<html>
<head>
<title>HTA Helpomatic</title>

<HTA:APPLICATION
ID="objHTAHelpomatic"
APPLICATIONNAME="HTAHelpomatic"
SCROLL="yes"
SINGLEINSTANCE="yes"
WINDOWSTATE="maximize"
>
</head>

<SCRIPT Language="VBScript">


Sub RunScript
Msgbox DropDown1.Value
End Sub



''''''''''''''''''''''''''''''''''''''''''''''''
strtext = DropDown1.value
Const FOR_READING = 1
Const FOR_WRITING = 2

strFileName = "test.txt"
strNewContent = "sample string content"

Set objFS = CreateObject("Scripting.FileSystemObject")
Set objTS = objFS.OpenTextFile(strFileName,FOR_READING)
strContents = objTS.ReadAll
objTS.Close
Set objTS = objFS.OpenTextFile(strFileName,FOR_WRITING)
objTS.WriteLine strComputer
objTS.Write strContents
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

</SCRIPT>
<body>
<fieldset>
<select size="1" name="DropDown1">
<option value="1">Option 1</option>
<option value="2">Option 2</option>
<option value="3">Option 3</option>
<option value="4">Option 4</option>
</select>
</fieldset>

<input id=runbutton class="button" type="button" value="Run Script"
name="ok_button"onClick="RunScript">

<input id=runbutton class="button" type="button" value="Cancel"
name="cancel_button" onClick="CancelScript">
<P>
<span id=DataArea></span>

</body>
</html>

Re: Take DropDown selection and Write to a text file by Ayush

Ayush
Mon Jan 29 15:46:57 CST 2007

Replied to [imaciscoguy]s message :
> Can anyone help me?
> I am attempting to take the selection from a DropDown box and write
> that selection to a text file.
> Any help would be greatly appreciated.
>
> Thanks,
> Cisco
>

If you want the value of selected option then use :
DropDown1.options(DropDown1.selectedIndex).value

DropDown1 is select Element
DropDown1.options is a collection of option elements

DropDown1.selectedIndex returns the index of selected option

so
DropDown1.options(DropDown1.selectedIndex) = the selected option element
and
DropDown1.options(DropDown1.selectedIndex).value = the selected option element's
value attribute/property


--
â?? Ayush
-------------
Search - www.Google.com | Wikipedia - http://en.wikipedia.org
Snip your long urls - http://snipurl.com/
-------------

Re: Take DropDown selection and Write to a text file by Paul

Paul
Mon Jan 29 19:29:52 CST 2007


"Ayush" <"ayushmaan.j[aatt]gmail.com"> wrote in message
news:ujqsi8%23QHHA.4476@TK2MSFTNGP05.phx.gbl...
> If you want the value of selected option then use :
> DropDown1.options(DropDown1.selectedIndex).value

I think that DropDown1.value is the same as
DropDown1.options(DropDown1.selectedIndex).value. Am I wrong?

-Paul Randall



Re: Take DropDown selection and Write to a text file by Ayush

Ayush
Mon Jan 29 19:43:10 CST 2007

Replied to [Paul Randall]s message :
> "Ayush" <"ayushmaan.j[aatt]gmail.com"> wrote in message
> news:ujqsi8%23QHHA.4476@TK2MSFTNGP05.phx.gbl...
>> If you want the value of selected option then use :
>> DropDown1.options(DropDown1.selectedIndex).value
>
> I think that DropDown1.value is the same as
> DropDown1.options(DropDown1.selectedIndex).value. Am I wrong?
>
> -Paul Randall
>
>

Yeah, that works .. so you are right ... i didn't know about that ..

--
â?? Ayush
-------------
Search - www.Google.com | Wikipedia - http://en.wikipedia.org
Snip your long urls - http://snipurl.com/
-------------