0
   

Store Form data in csv file

 
 
Reply Sat 22 Feb, 2014 08:48 am
Hello

I have a form page on

\\10.20.30.40\project\test\hello\Daily Reports\text.html

and I want to data in .csv format under \\10.20.30.40\project\test\hello\data.csv

but after press the submit button the error mag display

Error: Number:-2146827859 Description:Automation server can't create object


Please help me its urgent for me, I providing you the code of form


<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Name</title>
<SCRIPT LANGUAGE='JavaScript'>
function WriteToFile() {
try {
var fso, s;
fso = new ActiveXObject("Scripting.FileSystemObject");
s = fso.OpenTextFile("d:\\test\\ietm_data.csv" , 8, true, 0);
s.writeline(document.ietmdata.name.value + ", " + document.ietmdata.email.value + ", " +
document.ietmdata.location.value + ", " + document.ietmdata.comments.value + ", " +
document.ietmdata.type.value + ", " + document.ietmdata.problem.value + "," + document.ietmdata.detail.value);
s.Close();
}
catch(err){
var strErr = 'Error:';
strErr += '\nNumber:' + err.number;
strErr += '\nDescription:' + err.description;
document.write(strErr);
}
}

</SCRIPT>

</head>
<BODY>
<form action="test.hta" method="post" name="ietmdata" >
Name: <input type = "text" name="name"><br>
Email: <input type="text" name="email"><br>
Location: <input type = "text" name="location"><br>
Comments: <textarea name="comments"> </textarea><br>

Type: <select name="type" >

<option value="Software"> Software </option>
<option value="Hardware"> Hardware </option>
</select>
<br> <br>
<p> Requesting information:<BR>

<select name="problem">
<option value="Option1"> Option1</option>
<option value="Option2"> Option2</option>
</select> </p>

<p> Requesting Detail:<BR>

<select name="detail">
<option value="Male"> Male</option>
<option value="Female"> Female</option>

</select>
</p> <br> <br> <br>
<INPUT TYPE=BUTTON VALUE="Submit Data to Text File" onClick="WriteToFile(this.form)">
</form>
</body></html>



Thanking You
Manish Kumar
  • Topic Stats
  • Top Replies
  • Link to this Topic
Type: Question • Score: 0 • Views: 647 • Replies: 0
No top replies

 
 

Related Topics

Clone of Micosoft Office - Question by Advocate
Do You Turn Off Your Computer at Night? - Discussion by Phoenix32890
The "Death" of the Computer Mouse - Discussion by Phoenix32890
Windows 10... - Discussion by Region Philbis
Surface Pro 3: What do you think? - Question by neologist
Windows 8 tips thread - Discussion by Wilso
GOOGLE CHROME - Question by Setanta
.Net and Firefox... - Discussion by gungasnake
Hacking a computer and remote access - Discussion by trying2learn
 
  1. Forums
  2. » Store Form data in csv file
Copyright © 2024 MadLab, LLC :: Terms of Service :: Privacy Policy :: Page generated in 0.04 seconds on 04/26/2024 at 05:38:04