wrigha
asked on
Dynamically loading a text box from a text file using VBScript
Hi,
Just to be clear upfront... I am a total novice at this so please excuse my ignorance.
I am writing some utilities to replace some client side functions.
On one of them I need to load the contents of a list box from a text file which changes daily.
I have been directed to provide this solution in scripting only (VBS or Java Script, preferably VBS).
Please help.
Thanks.
Just to be clear upfront... I am a total novice at this so please excuse my ignorance.
I am writing some utilities to replace some client side functions.
On one of them I need to load the contents of a list box from a text file which changes daily.
I have been directed to provide this solution in scripting only (VBS or Java Script, preferably VBS).
Please help.
Thanks.
ASKER
Thanks for your reply.
Unfortuntely nothing happens. Just an empty text box is shown.
Here is the html code:
<HTML>
<BODY>
<%
set scr = server.createobject("scrip ting.files ystemobjec t")
set txt = scr.opentextfile("users.tx t",1,0)
sBuffer= txt.ReadAll()
msgbox(sbuffer)
txt.close()
set scr = nothing
sSplit = Split(sBuffer, vbCRLF)
%>
<select name="test" size=20>
<%
for i = 1 to ubound(sSplit)
Response.Write "<option value='" & sSplit(i) & "'>" & sSplit(i) & "</option>"
next
%>
</select>
</BODY>
</HTML>
Thanks
Unfortuntely nothing happens. Just an empty text box is shown.
Here is the html code:
<HTML>
<BODY>
<%
set scr = server.createobject("scrip
set txt = scr.opentextfile("users.tx
sBuffer= txt.ReadAll()
msgbox(sbuffer)
txt.close()
set scr = nothing
sSplit = Split(sBuffer, vbCRLF)
%>
<select name="test" size=20>
<%
for i = 1 to ubound(sSplit)
Response.Write "<option value='" & sSplit(i) & "'>" & sSplit(i) & "</option>"
next
%>
</select>
</BODY>
</HTML>
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
set scr = server.createobject("scrip
set txt = scr.opentextfile(filename,
sBuffer= txt.ReadAll()
txt.close()
set scr = nothing
sSplit = Split(sBuffer, vbCRLF)
%>
<select size=20>
<%
for i = 1 to ubound(sSplit)
Response.Write "<option value='" & sSplit(i) & "'>" & sSplit(i) & "</option>
next
%>
</select>