Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New Coder
    Join Date
    Nov 2012
    Posts
    11
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Save button not working

    I want ti save the file in local drive as csv format when i click the button save..I need a function which will do that for me.I have left the function saveFile() blank because i dun know what to put..I am new to ASP..can anyone help me with this...TQ

    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()
    
    
    
    
    
    End sub
    
    </script>
    </head>
    <body>
    
    
    <form='form1' action="#" method="get">
    <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>

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    26,536
    Thanks
    80
    Thanked 4,490 Times in 4,454 Posts
    There is no ASP code anywhere in that.

    And if you really mean what you say about storing data *locally*, then you have no reason to use ASP. (If you did, you would have to ensure that EVERY USER had correctly installed ASP on his/her machine...which isn't really possible with the HOME editions of Windows. You need at least the next level up from the HOME editions.)

    All you are doing is using VBScript instead of JavaScript in a web page. You do know that means that *ONLY* MSIE users will be able to use the page?
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •