1

I would like to write the data results from a form to the csv (or excel). I want to save this results in the server serverless (without php, etc.).

I have found this code:

<html>
  <head>
  <script language="javascript">
    function WriteToFile(passForm) {
      var fso = new ActiveXObject("Scripting.FileSystemObject");
      var fileLoc = "C:\\sample.csv";
      var file = fso.CreateTextFile(fileLoc, true);
      file.writeline(passForm.FirstName.value + ',' +
                     passForm.LastName.value);
      file.Close();
      alert('File created successfully at location: ' + fileLoc);
     }
  </script>
  </head>
  <body>
  <p>create a csv file with following details -</p>
  <form>
    Type your first name: <input type="text" name="FirstName" size="20">

    Type your last name: <input type="text" name="LastName" size="20">

    <input type="button" value="submit" onclick="WriteToFile(this.form)">
  </form>
  </body>
</html>
</br></br></html>

But it does work only with IE.

How to solve this problem?

Regards

2
  • I want to save this results in the server serverless (without php, etc.). And how do you think that would work? Commented Sep 29, 2015 at 13:05
  • If what you want is something that runs completely locally, with no server involved, and does things that are outside of the security model of the web, why not just write a simple native app? Commented Oct 1, 2015 at 12:57

1 Answer 1

1

as i understand your question and searched i found that

ActiveX is only supported by IE - the other browsers use a plugin architecture called NPAPI. However, there's a cross-browser plugin framework called Firebreath that you might find useful.

you can refer to this question

refer question 1

refer question 2

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.