View Full Version : Send form results to a text file
Please can you help me on how to send form results to a text file
Nightfire
09-05-2002, 02:13 PM
As far as I know, you can't write to files with javascript. You need a serverside language
brothercake
09-05-2002, 04:31 PM
You can do it using an activeX control, but it wouldn't work on the internet -- only on an intranet - and even then only in IE
If you do it server-side it's trivial, so I'd suggest that route
hat7159
10-15-2002, 02:26 AM
What would that activex control look like, regarding syntax that is?
glenngv
10-15-2002, 03:06 AM
yes you can do it using activex control but that would create the file in the user's machine not the server's. Is that what you really wanted?
hat7159
10-15-2002, 05:14 AM
i am administering a form at a computer station and using html for the form style....there is a need to transfer the results of the form to Excel...whereas the computer is connected to a network...none of the network will be used....all of the files are run from the hard disk....so i am looking for how to use activex to access excel....the file will be technically "client-side" but since for my purposes it will work....so yes, i have had trouble getting the activex object to create...keep getting error messages...so that is what i am up against. i hope that clears things up
Roy Sinclair
10-15-2002, 02:40 PM
Originally posted by hat7159
i am administering a form at a computer station and using html for the form style....there is a need to transfer the results of the form to Excel...whereas the computer is connected to a network...none of the network will be used....all of the files are run from the hard disk....so i am looking for how to use activex to access excel....the file will be technically "client-side" but since for my purposes it will work....so yes, i have had trouble getting the activex object to create...keep getting error messages...so that is what i am up against. i hope that clears things up
In that case you have an entirely different and much simpler option available. You can use the File System Object (actually it is and ActiveX control) which is well documented using Javascript to control it or VBScript if you're more comfortable going that route.
A good starting point for researching either of those is http://msdn.microsoft.com/library/default.asp?url=/nhp/Default.asp?contentid=28001169
hat7159
10-16-2002, 01:16 AM
Thanks for all your help so far. I have been investigating the file system object, but the documentation that i have found does not seem to mention that it is compatible with an Excel WorkSheet. I have also tried to fool around with it (using JavaScript), but I am getting the syntax wrong. What do I have to do after the following to make it work? (be able to input data into cells) Thanks again for all your help.
var fso, f1;
fso = new ActiveXObject("Scripting.FileSystemObject");
f1 = fso.GetFile("c:\\test.xls");
whammy
10-16-2002, 01:22 AM
Check out http://www.w3schools.com/asp
...and look for Scripting.FileSystemObject. You might want to just save the stuff as a comma-delimited file and then import it into Access.
When you are importing the file into Access, you have all kinds of options, and the easiest one (I think) is to import a comma delimited file with double quote text delimiters... It supports that very well...
Then you shouldn't have any problem with Excel, I think...
I don't use Excel much, but I do use Access sometimes. :D
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.