SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Member
    Join Date
    May 2007
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Capture Form to a Text File

    Hi, All. I have a web server built in to our Student Data system. I want to put a teacher survey form out there but can't modify the DB and have no cgi ... darn proprietary web server.

    Can I use JS to save form values to a separate text file? So far the best I can do is appendData() into the current html.

    Thanks, Mark

  2. #2
    Programming Team silver trophybronze trophy
    Mittineague's Avatar
    Join Date
    Jul 2005
    Location
    West Springfield, Massachusetts
    Posts
    17,290
    Mentioned
    198 Post(s)
    Tagged
    3 Thread(s)

    javscript write to text file

    Hi mlenihan, welcome to the forums,
    I don't understand your requirements, but you may be able to use javascript to write to a text file on the user's computer, if your users have Windows OS. eg.
    Code JavaScript:
    function WriteToFile() {
       var theText;
       theText = document.myForm.textArea.value;
       var fso, f;
       var ForReading = 1, ForWriting = 2;
       fso = new ActiveXObject("Scripting.FileSystemObject");
       f = fso.OpenTextFile("A:\\results.txt", ForWriting, true);
       f.Write(theText);
       f.Close();
    }


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •