How add new hidden input fields to the form on submit
<p>I'm doing some conditional checks and want to pass certain hidden variables to a request.</p>

<p>For example I want to pass these if this condition passes:</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 VARIBALES 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;
</code></pre>
