CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   ASP (http://www.codingforums.com/forumdisplay.php?f=8)
-   -   I want to save this file in local drive after all the input have key-in.... (http://www.codingforums.com/showthread.php?t=284277)

bheema 12-17-2012 07:00 AM

I want to save this file in local drive after all the input have key-in....
 
I want to save the form after the input from user in xml or csv file...How can I do that?

Code:

<html>
<head><script language="VBScript">
count=2
Sub doAddRow()
  Dim oTbl, oRow, oCell
  Set oTbl=document.getElementById("mytable")
  Set oRow = oTbl.insertRow
  Set oCell = oRow.insertCell
  oCell.innerHTML= "<input name='Lot Number' type='text' id='Lot Number"&count&"' value='' />"
  Set oCell = oRow.insertCell
  oCell.innerHTML= "<input name='Location' type='text' id='Lot Number"&count&"' value='' />"
  Set oCell = oRow.insertCell
  oCell.innerHTML= "<input name='Total In' type='text' id='Lot Number"&count&"' value='' />"
  Set oCell = oRow.insertCell
  oCell.innerHTML= "<input name='1 * Test' type='text' id='Lot Number"&count&"' value='' />"
  Set oCell = oRow.insertCell
  oCell.innerHTML= "<input name='2 * Test' type='text' id='Lot Number"&count&"' value='' />"
  Set oCell = oRow.insertCell
  oCell.innerHTML= "<input name='3 * Test' type='text' id='Lot Number"&count&"' value='' />"
  Set oCell = oRow.insertCell
  oCell.innerHTML= "<input name='Total Out' type='text' id='Lot Number"&count&"' value='' />"
  Set oCell = oRow.insertCell
  oCell.innerHTML= "<input name='Lot Status' type='text' id='Lot Number"&count&"' value='' />"
  Set oCell = oRow.insertCell
  oCell.innerHTML= "<input name='Remark' type='text' id='Lot Number"&count&"' value='' />"

count = count+1
End Sub

Sub deleteRow()
Dim oTbl, oRow
Set oTbl=document.getElementById("mytable")

if count>2 then
oTbl.deleteRow(count-1)
count = count -1
end if

End sub

Sub doAddRow2()
  Dim oTbl, oRow, oCell
  Set oTbl=document.getElementById("mytable2")
  Set oRow = oTbl.insertRow
  Set oCell = oRow.insertCell
  oCell.innerHTML= "<input name='Entry' type='text' id='Entry"&count&"' value='' />"
  Set oCell = oRow.insertCell
  oCell.innerHTML= "<input name='Down' type='text' id='Entry"&count&"' value='' />"
  Set oCell = oRow.insertCell
  oCell.innerHTML= "<input name='Up' type='text' id='Entry"&count&"' value='' />"
  Set oCell = oRow.insertCell
  oCell.innerHTML= "<input name='Failure Mode/Action/Remark' size=40 type='text'  id='Entry"&count&"' value='' />"
  Set oCell = oRow.insertCell
  oCell.innerHTML= "<input name='D/T' type='text' id='Entry"&count&"' value='' />"
  Set oCell = oRow.insertCell
  oCell.innerHTML= "<input name='Attended By' type='text' id='Entry"&count&"' value='' />"
 
count = count+1
End Sub

Sub deleteRow2()
Dim oTbl, oRow
Set oTbl=document.getElementById("mytable2")

if count>2 then
oTbl.deleteRow(count-1)
count = count -1
end if

End sub

Sub saveFile()
Dim txtPath
Dim txtName

txtPath = "C:\Shared Folder\Emp InfoPath Forms"
txtName = "form1.xml"

XDocument.SaveAS(txtPath & txtName)
End sub

</script>
</head>
<body>


<form='form1' action="http://example.com" method="POST">
<div id ="myOutput" style="border:2px solid black">

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>
</p>
<p>
</p>

<table id="mytable" border='1'>
      <tr><td><center>Lot Number</center></td>
        <td><center>Location</center></td>
        <td><center>Total In</center></td>
        <td><center>1 * Test</center></td>
        <td><center>2 * Test</center></td>
        <td><center>3 * Test</center></td>
        <td><center>Total Out</center></td>
        <td><center>Lot Status</center></td>
        <td><center>Remark</center></td></tr>
    <TR>
      <TD> <input name="Lot Number" type="text" id="Lot Number" /></TD>
      <TD> <input name="Location" type="text" id="Location" /></TD>
      <TD> <input name="Total In" type="text" id="Total In" /></TD>
      <TD> <input name="1 * Test" type="text" id="1* Test" /></TD>
      <TD> <input name="2 * Test" type="text" id="2 * Test" /></TD>
      <TD> <input name="3 * Test" type="text" id="3 * Test" /></TD>
      <TD> <input name="Total Out" type="text" id="Total Out" /></TD>
      <TD> <input name="Lot Status" type="text" id="Lot Status" /></TD>
      <TD> <input name="Remark" type="text" id="Remark" /></TD>
    </TR>
  </table>
<br />

<INPUT TYPE="button" value="Add" onclick="doAddRow()">
<INPUT TYPE="button" value="Delete" onclick="deleteRow()">

</p>
<p>
</p>

<table id="mytable2" border='1'>
      <tr><td><center>Entry</center></td>
        <td><center>Down</center></td>
        <td><center>Up</center></td>
        <td><center>Failure Mode/Action/Remark</center></td>
        <td><center>D/T</center></td>
        <td><center>Attended By</center></td></tr>
    <TR>
      <TD> <input name="Entry" type="text" id="Entry" /></TD>
      <TD> <input name="Down" type="text" id="Down" /></TD>
      <TD> <input name="Up" type="text" id="Up" /></TD>
      <TD> <input name="Failure Mode/Action/Remark" type="text" id="Failure Mode/Action/Remark" size="40" /></TD>
      <TD> <input name="D/T" type="text" id="D/T" /></TD>
      <TD> <input name="Attended By" type="text" id="Attended By" /></TD>
    </TR>
 </table>
<br />

<INPUT TYPE="button" value="Add" onclick="doAddRow2()">
<INPUT TYPE="button" value="Delete" onclick="deleteRow2()">

</div>

<INPUT TYPE="button" value="Save" onclick="saveFile()">

</form>

</body>
</html>



All times are GMT +1. The time now is 07:51 PM.

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