Hello,
I'm trying to have a user input their name on a webpage and then have the webpage store that name in a text file on the server. I have a form on a webpage where a user types their name in and then after pressing submit the name gets saved in a text file. But for some reason this does not work for me. Please help!! Here is my code.
I'm trying to have a user input their name on a webpage and then have the webpage store that name in a text file on the server. I have a form on a webpage where a user types their name in and then after pressing submit the name gets saved in a text file. But for some reason this does not work for me. Please help!! Here is my code.
Code:
<SCRIPT LANGUAGE="JavaScript">
function WriteToFile(passForm) {
set fso = CreateObject("Scripting.FileSystemObject");
set s = fso.CreateTextFile("C:\test.txt", True);
s.writeline("HI");
s.writeline("Bye");
s.writeline("-----------------------------");
s.Close();
}
</SCRIPT>
</head>
<body>
<p>To sign up for the Excel workshop please fill out the form below:
</p>
<form onSubmit="WriteToFile(this)">
Type your first name:
<input type="text" name="FirstName" size="20">
<br>Type your last name:
<input type="text" name="LastName" size="20">
<br>
<input type="submit" value="submit">
</form>