0

I have this simple websiteenter image description here

Where I would like the user to enter his email in the textbox with the "someone@example.com" placeholder, and upon pressing on the Email checkbox, I would like to store his email in a text file for web development. What I made was this:

<input type="textbox" placeholder="someone@example.com" id="email"/>
<input type="checkbox" OnClick="develop(email)" value="done" />Email</br>

and the function I made with Javascript was:

function develop(stored)
        {
            var file = "bank.txt"; // Where I want to store the info
            store1 = document.getElementById(email);
            writeTextFile(file, store1.innerHtml());
        }

This, however, didn't work. What Am I doing wrong and What should I do?

Dark Eagle
  • 107
  • 3
  • 10

1 Answers1

0

accessing files on the client side is not permitted unless it was uploaded by the user.

take a look at the following link to see how client side file access works.

Local file access with javascript

you may like to use cookies to store the data if you like to use it on the client side:

How to use JavaScript Cookies

Community
  • 1
  • 1
Sina Mansour L.
  • 418
  • 4
  • 8