title: HTML form to a Excel spreadsheet (database)
body: <p>I would like some help not modifying this code</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;script type="text/javascript"&gt;
  function fillHidTable(){
  var htqf; //-- hidden field
  var rf; //-- retrieved field
  for ( var i = 1; i &lt; 5; i++ ) {
      rf = "htqf"+i;
      document.getElementById(rf).innerHTML = document.getElementById("Q"+i+"CALC").value;
  }
  tableToExcel('hidTable', 'Analysis Results');
  }
  
  var tableToExcel = (function() {
  var uri = 'data:application/vnd.ms-excel;base64,'
          , template = '&lt;html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"&gt;&lt;head&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;&lt;x:ExcelWorkbook&gt;&lt;x:ExcelWorksheets&gt;&lt;x:ExcelWorksheet&gt;&lt;x:Name&gt;{worksheet}&lt;/x:Name&gt;&lt;x:WorksheetOptions&gt;&lt;x:DisplayGridlines/&gt;&lt;/x:WorksheetOptions&gt;&lt;/x:ExcelWorksheet&gt;&lt;/x:ExcelWorksheets&gt;&lt;/x:ExcelWorkbook&gt;&lt;/xml&gt;&lt;![endif]--&gt;&lt;/head&gt;&lt;body&gt;&lt;table&gt;{table}&lt;/table&gt;&lt;/body&gt;&lt;/html&gt;'
          , base64 = function(s) { return window.btoa(unescape(encodeURIComponent(s))) }
          , format = function(s, c) { return s.replace(/{(\w+)}/g, function(m, p) { return c[p]; }) }
  return function(table, name) {
      if (!table.nodeType) table = document.getElementById(table)
      var ctx = {worksheet: name || 'Worksheet', table: table.innerHTML}
      window.location.href = uri + base64(format(template, ctx))
  }
  })()
  &lt;/script&gt;
  
  &lt;title&gt;HTML Form Data to Excel&lt;/title&gt;
  
  &lt;META NAME="Generator" CONTENT="EditPlus"&gt;
  &lt;META NAME="Author" CONTENT=""&gt;
  &lt;META NAME="Keywords" CONTENT=""&gt;
  &lt;META NAME="Description" CONTENT=""&gt;
  
  
  &lt;style type="text/css" media="screen"&gt;
  .divCenMid{font-family:Arial,sans-serif;font-size:14pt;font-style:normal;font-weight:700;text-align:center;vertical-align:middle;margin:0;}
  .allbdrCenMid{border:.75pt solid windowtext;color:#000;font-family:Arial,sans-serif;font-size:10pt;font-style:normal;font-weight:400;text-align:center;vertical-align:middle;margin:0;}
  .allbdrCenTop{border:.75pt solid windowtext;color:#000;font-family:Arial,sans-serif;font-size:10pt;font-style:normal;font-weight:400;text-align:center;vertical-align:top;margin:0;}
  .allbdrLtMid{border:.75pt solid windowtext;color:#000;font-family:Arial,sans-serif;font-size:10pt;font-style:normal;font-weight:400;text-align:left;vertical-align:middle;margin:0;}
  .allbdrLtTop{border:.75pt solid windowtext;color:#000;font-family:Arial,sans-serif;font-size:10pt;font-style:normal;font-weight:400;text-align:left;vertical-align:top;margin:0;}
  
  &lt;/style&gt;
  
  &lt;/head&gt;
  
  &lt;body&gt;
  
  &lt;table width= "565px" cellspacing="0" cellpadding="0" style="border-spacing:0;" id="QMSTable"&gt;
  &lt;col width="25px"/&gt;
  &lt;col width="120px"/&gt;
  &lt;col width="360px"/&gt;
  &lt;col width="60px"/&gt;
  &lt;tr&gt;
      &lt;td class="divCenMid" colspan = "4"&gt; QMS Assessment&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
      &lt;td class="allbdrCenMid"&gt; No&lt;/td&gt;
      &lt;td class="allbdrCenMid"&gt; Criteria&lt;/td&gt;
      &lt;td class="allbdrLtMid"&gt; Question&lt;/td&gt;
      &lt;td class="allbdrCenMid"&gt; Score&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
      &lt;td class="allbdrCenTop"&gt; Q1&lt;/td&gt;
      &lt;td class="allbdrLtTop"&gt; Quality Unit Independency&lt;/td&gt;
      &lt;td class="allbdrLtTop"&gt; Do you have the Quality Unit?&lt;/td&gt;
      &lt;td class="allbdrCenMid"&gt;
          &lt;input id="Q1CALC" type="text" value="" class="nobdrCenMid" style="overflow:hidden; width:93% " name="Q1CALC"/&gt;
      &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
      &lt;td class="allbdrCenTop"&gt; Q2&lt;/td&gt;
      &lt;td class="allbdrLtTop"&gt; Apply PICS GMP&lt;/td&gt;
      &lt;td class="allbdrLtTop"&gt; Which GMP regulation do you use?&lt;/td&gt;
      &lt;td class="allbdrCenMid"&gt;
          &lt;input id="Q2CALC" type="text" value="" class="nobdrCenMid" style="overflow:hidden; width:93% " name="Q2CALC"/&gt;
      &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
      &lt;td class="allbdrCenTop"&gt; Q3&lt;/td&gt;
      &lt;td class="allbdrLtTop"&gt; Deviation or Non-conformance&lt;/td&gt;
      &lt;td class="allbdrLtTop"&gt; Do you have a deviation or non-conformance procedure?&lt;/td&gt;
      &lt;td class="allbdrCenMid"&gt;
          &lt;input id="Q3CALC" type="text" value="" class="nobdrCenMid" style="overflow:hidden; width:93% " name="Q3CALC"/&gt;
      &lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
      &lt;td class="allbdrCenTop"&gt; Q4&lt;/td&gt;
      &lt;td class="allbdrLtTop"&gt; Complaint&lt;/td&gt;
      &lt;td class="allbdrLtTop"&gt; Do you have a customer complaint procedure?&lt;/td&gt;
      &lt;td class="allbdrCenMid"&gt;
          &lt;input id="Q4CALC" type="text" value="" class="nobdrCenMid" style="overflow:hidden; width:93% " name="Q4CALC"/&gt;
      &lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  
  &lt;div id="hidTable" style="display: none"&gt;
  &lt;table id="testTable"&gt;
      &lt;caption&gt;Supplier Risk Analysis&lt;/caption&gt;
      &lt;colgroup&gt;&lt;/colgroup&gt;
      &lt;colgroup&gt;&lt;/colgroup&gt;
      &lt;colgroup&gt;&lt;/colgroup&gt;
      &lt;thead&gt;
      &lt;tr&gt;
          &lt;th&gt;No.&lt;/th&gt;
          &lt;th&gt;Question&lt;/th&gt;
          &lt;th&gt;Score&lt;/th&gt;
      &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
      &lt;tr&gt;
          &lt;td&gt;Q1&lt;/td&gt;
          &lt;td&gt;Do you have the Quality Unit?&lt;/td&gt;
          &lt;td id="htqf1"&gt;-&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;Q2&lt;/td&gt;
          &lt;td&gt;Apply PICS GMP?&lt;/td&gt;
          &lt;td id="htqf2"&gt;-&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;Q3&lt;/td&gt;
          &lt;td&gt;Do you have a deviation or non-conformance procedure?&lt;/td&gt;
          &lt;td id="htqf3"&gt;-&lt;/td&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;Q4&lt;/td&gt;
          &lt;td&gt;Do you have a customer complaint procedure?&lt;/td&gt;
          &lt;td id="htqf4"&gt;-&lt;/td&gt;
      &lt;/tr&gt;
      &lt;/tbody&gt;
  &lt;/table&gt;
  &lt;/div&gt;
  
  &lt;input type="button" onclick="fillHidTable()" name=PatientDatabase value="Export Data to Excel"&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>It makes a web based form which I can play with and edit, but is there a way I can just change the last button to save the excel table into cells to make more of a database and is there a way I can save it to a specific file and to have it fill in or append the data.</p>