title: How to add a new hidden input fields to the form on submit
body: <p>I want to pass certain hidden parameters in a request when some conditions are met.</p>
  
  <p>For example I want to pass these if this condition is true:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt; 
   function checkClosureLevel()
   {
      var openLevel = document.getElementById('openLevel');
      var phyCompLevel = document.getElementById('phyCompLevel');
      var finCompLevel = document.getElementById('finCompLevel');
  
      if (openLevel.checked) { 
        //PASS HIDDEN FORM VARIABLES HERE AND SUBMIT FORM 
      }
   }
  &lt;/script&gt;
  
  &lt;form action="process.det_details" method="post" name="detParameterForm"&gt;
    &lt;fieldset class="det"&gt;
      &lt;legend&gt;Closure Level&lt;/legend&gt;
      &lt;input type="checkbox" name="openLevel" &gt;Open&lt;/input&gt;&lt;br/&gt;
      &lt;input type="checkbox" name="phyCompLevel" &gt;Physically Complete&lt;/input&gt;
      &lt;br/&gt;
      &lt;input type="checkbox" name="finCompLevel" &gt;Financially Complete&lt;/input&gt;
    &lt;/fieldset&gt;
  &lt;/form&gt;
  </code></pre>