Ok, this should be a simple question for anyone other than a beginner like me...
I'm trying to write the contents of a textarea to a file. I have the code to write to the file, I just can't figure out how to pass the content/value of the text area to a variable, then to the file on a button click. My knowledge of forms is extremely limited, so I'm not sure what method and/or action to use in conjunction with this.
TIA.
<form action="" method="post" name="UpdateACOE">
<textarea name="txtUpdateACOE" cols="60" rows="20"></textarea>
<input name="save" type="button" id ="save" value="Save">
sub save_onclick
dim Str
Str = request("txtUpdateACOE"
dim objFSO
set objFSO = Server.CreateObject("Scripting.FileSystemObject"
if objFSO.FileExists ("acoe.txt"
then
dim objTextStream
set objTextStream = objFSO.OpenTextFile ("acoe.txt", 2)
objTextStream.write str
objTextStream.Close
set objTextStream = Nothing
Set objFSO = Nothing
end if
end sub
</script>
</form>
I'm trying to write the contents of a textarea to a file. I have the code to write to the file, I just can't figure out how to pass the content/value of the text area to a variable, then to the file on a button click. My knowledge of forms is extremely limited, so I'm not sure what method and/or action to use in conjunction with this.
TIA.
<form action="" method="post" name="UpdateACOE">
<textarea name="txtUpdateACOE" cols="60" rows="20"></textarea>
<input name="save" type="button" id ="save" value="Save">
sub save_onclick
dim Str
Str = request("txtUpdateACOE"
dim objFSO
set objFSO = Server.CreateObject("Scripting.FileSystemObject"
if objFSO.FileExists ("acoe.txt"
dim objTextStream
set objTextStream = objFSO.OpenTextFile ("acoe.txt", 2)
objTextStream.write str
objTextStream.Close
set objTextStream = Nothing
Set objFSO = Nothing
end if
end sub
</script>
</form>