Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jul 2006
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Saving text in a text box as a .txt

    hi i was wondering how i could save text in a text box as a .txt on a click of a save button. I hope it is possibly so that it will finish my app off nicely

  • #2
    New Coder
    Join Date
    Aug 2006
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts
    What you need is the FileSystemObject. A short example:
    Code:
    function WriteToFile(sText){
      var fso = new ActiveXObject("Scripting.FileSystemObject");
      var s = fso.CreateTextFile("C:\\test.txt", true);
      s.WriteLine("helloworld");
      s.Close();
    }
    sText obviously are the contents of the textarea; you will have to pass them to this function. And let the user choose where he wants to store the textfile. Happy coding

  • #3
    New Coder
    Join Date
    Jul 2006
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks i hope this works


  •  

    Posting Permissions

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