CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   JavaScript programming (http://www.codingforums.com/forumdisplay.php?f=2)
-   -   HTML form using javascripct save in CSV format (http://www.codingforums.com/showthread.php?t=283507)

bheema 12-04-2012 04:01 AM

HTML form using javascripct save in CSV format
 
I want to save the input form using this makeFile() function.I want it to save the whole form in csv format in a share drive....How can i make it read the whole file...TQ...n Am i doing it correctly?Please help me solve this problem...


Code:

function makeFile(){
var fso = newActiveXObject("Scripting.FileSystemObject");
var fileLoc = "E:\sample.csv";
var file = fso.CreateTextFile(fileLoc, true);
file.writeline();
file.Close();
alert('File created successfully at location: ' + fileLoc);
}


<form name="form1" action="" method="get">
TESTER <input type="text"/>        DATE <input type="text" />        EMP NO <input type="text" />        6S DONE <input type="text" />

<br />
<br />

WW <input type="text" size="8"maxlength="8"/>        NAME <input type="text" />        SHIFT <input type="text" />

<br />
<br />
<br />

PASSOVER (Please verify Summit Receipe & Storm before start shift)

<br />
<br />
<br />


Summit Receipe OK ?
<select name="">
<option value="" style="display:none;"></option>       
<option value="Yes">Yes</option>       
<option value="No">No</option>       
</select>       

<br />
<br />

Motif/ Storm OK ?
<select name="">
<option value="" style="display:none;"></option>       
<option value="Yes">Yes</option>       
<option value="No">No</option>       
</select>       

<br />
<br />
<br />

<p>
<input type="button" value="Add" onclick="addRowToTable();" />
<input type="button" value="Delete" onclick="removeRowFromTable();" />
</p>
<p>
</p>
<table border="1" id="tblSample">
<tr>
<TH>Num</TH>
<TH>Lot Number</TH>
<TH>Location</TH>
<TH>Total In</TH>
<TH>1 * Test</TH>
<Th>2 * Test</TH>
<TH>3 * Test</TH>
<TH>Total Out</TH>
<TH>Lot Status</TH>
<TH>Remark</TH>

</tr>
</table>

<br />
<br />
<br />
<input type="button" value="Add" onclick="addRowToTable2();" />
<input type="button" value="Delete" onclick="removeRowFromTable2();" />
</p>
<p>
</p>
<table border="1" id="tbl">
<tr>
<TH>Num</TH>
<TH>Entry</TH>
<TH>Down</TH>
<TH>Up</TH>
<TH>Failure Mode/ Action/ Remark</TH>
<Th>D/T</TH>
<TH>Attended By</TH>

</tr>
</table>
<br />
<br />
<input type="submit" value="Submit" onclick="makeFile();"/>
</form>
</div>
</body>
</html>



All times are GMT +1. The time now is 02:29 PM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.