title: Passing select parameter along with the form data in html
body: <p>I have a sample feedback web page which displays div blocks with the input fields, corresponding to the department chosen using select element using some javascript logic and the source code is below</p>
  
  <pre><code>&lt;html&gt;
  
  &lt;body onload="deptSelector();"&gt; 
  
  
  &lt;script type="text/javascript"&gt;
      function init() {
          document.getElementById("ece").style.display = "block";
          document.getElementById("it").style.display = "none";
      }
  
      function deptSelector() {
          var val = document.getElementById("department").value;
          if(val == "Ece") {
              document.getElementById("ece").style.display = "block";
              document.getElementById("it").style.display = "none";
          } else {
              document.getElementById("ece").style.display = "none";
              document.getElementById("it").style.display = "block";      
          }   
      }
  &lt;/script&gt;
  
      &lt;div&gt;
          &lt;label&gt; Department:&lt;/label&gt;
          &lt;select id="department" name="dept" onchange="deptSelector()"&gt;          
              &lt;option value="Ece"&gt;Ece&lt;/option&gt;
              &lt;option value="IT"&gt;It&lt;/option&gt;
          &lt;/select&gt;
      &lt;/div&gt;  
  
      &lt;div id="ece"&gt;
          &lt;form id="eceFbForm" action="test.jsp" method="POST"&gt;
              &lt;label&gt; Enter the feedback for the following ECE staffs&lt;/label&gt;
              &lt;div&gt;
                  &lt;div&gt;
                      &lt;label&gt;Ece_staff_1:&lt;/label&gt;
                      &lt;input type="text" name="eceSt1"&gt;
                  &lt;/div&gt;
                  &lt;div&gt;
                      &lt;label&gt;Ece_staff_2:&lt;/label&gt;
                      &lt;input type="text" name="eceSt2"&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
              &lt;input type="submit" value="submit"&gt;        
          &lt;/form&gt;     
      &lt;/div&gt;
  
      &lt;div id="it"&gt;
          &lt;form id="itFbForm" action="test.jsp" method="POST"&gt;
              &lt;label&gt; Enter the feedback for the following IT staffs&lt;/label&gt;
              &lt;div&gt;
                  &lt;div&gt;
                      &lt;label&gt;It_staff_1:&lt;/label&gt;
                      &lt;input type="text" name="itSt1"&gt;
                  &lt;/div&gt;
                  &lt;div&gt;
                      &lt;label&gt;It_staff_2:&lt;/label&gt;
                      &lt;input type="text" name="itSt2"&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
              &lt;input type="submit" value="submit"&gt;        
          &lt;/form&gt;     
      &lt;/div&gt;
  &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p>Currently i am not able to pass the select option parameter in the post data because the forms are in separate div blocks. So how do i re-alter the forms so that i get the select option parameter along with only the options input by the user corresponding to the div block?</p>