Guest_imported
New member
- Jan 1, 1970
- 0
In VBscript im trying to grab the text inputed from an array that is displayed in HTML body add text to it and then save it back to the same array file i pulled the origional text form. All i can find out there on tutorials or at the bookstore is how to writelines writeblanklines, or write text that is imputed inside the code. However, I need the newfile.write "TEXTvariable?" below in the function to be something dynamic like a variable. Anyways im just trying to figure out how to capture and write the text at the moment. Here what ive been working on, i've been running this file as a .hta and creating that file on my c:
<html>
<SCRIPT LANGUAGE="VBScript">
<!-- hide from older browsers
function writeTest()
Dim filesys, newfile
Set filesys = CreateObject("Scripting.FileSystemObject"
Set newfile = filesys.CreateTextFile("text.tab", True)
newfile.write "TEXT Variable?"
newfile.Close
end function
// stop hiding -->
</SCRIPT>
<BODY ID=body1>
<OBJECT ID=elements CLASSID="clsid:333C7BC4-460F-11D0-BC04-0080C7055A83">
<PARAM NAME="DataURL" VALUE="text.tab">
<PARAM NAME="UseHeader" VALUE="True">
<PARAM NAME="FieldDelim" VALUE="|">
<PARAM NAME="EscapeChar" VALUE="*">
<PARAM NAME="TextQualifier" VALUE="'">
<PARAM NAME="Sort" VALUE="Filename">
</OBJECT>
<TABLE datasrc=#elements BORDER CELLPADDING=2 BGCOLOR="#BBB8DC" STYLE="margin-left:5">
<THEAD>
<TR>
<TD><B>Question</B></TD>
<TD><B>Answer</B></TD>
</TR></THEAD>
<TBODY>
<TR>
<TD><DIV datafld="Question"></DIV></TD>
<TD><DIV datafld="Answer"></DIV></TD>
</TR></TBODY>
</TABLE>
<FORM NAME="testbutton">
<INPUT TYPE="button" NAME="but2" VALUE="Update" onClick="writeTest()">
</FORM>
</body>
</html>
The text.tab file looks like this:
Question|Answer
How old are you?|28
Where are you?|Here i am
Ive tired making variables and doing something like this: document.all.body1.createTextRange() I can't seem to figure this out, if anyone can help id appreciate it.
<html>
<SCRIPT LANGUAGE="VBScript">
<!-- hide from older browsers
function writeTest()
Dim filesys, newfile
Set filesys = CreateObject("Scripting.FileSystemObject"
Set newfile = filesys.CreateTextFile("text.tab", True)
newfile.write "TEXT Variable?"
newfile.Close
end function
// stop hiding -->
</SCRIPT>
<BODY ID=body1>
<OBJECT ID=elements CLASSID="clsid:333C7BC4-460F-11D0-BC04-0080C7055A83">
<PARAM NAME="DataURL" VALUE="text.tab">
<PARAM NAME="UseHeader" VALUE="True">
<PARAM NAME="FieldDelim" VALUE="|">
<PARAM NAME="EscapeChar" VALUE="*">
<PARAM NAME="TextQualifier" VALUE="'">
<PARAM NAME="Sort" VALUE="Filename">
</OBJECT>
<TABLE datasrc=#elements BORDER CELLPADDING=2 BGCOLOR="#BBB8DC" STYLE="margin-left:5">
<THEAD>
<TR>
<TD><B>Question</B></TD>
<TD><B>Answer</B></TD>
</TR></THEAD>
<TBODY>
<TR>
<TD><DIV datafld="Question"></DIV></TD>
<TD><DIV datafld="Answer"></DIV></TD>
</TR></TBODY>
</TABLE>
<FORM NAME="testbutton">
<INPUT TYPE="button" NAME="but2" VALUE="Update" onClick="writeTest()">
</FORM>
</body>
</html>
The text.tab file looks like this:
Question|Answer
How old are you?|28
Where are you?|Here i am
Ive tired making variables and doing something like this: document.all.body1.createTextRange() I can't seem to figure this out, if anyone can help id appreciate it.