title: get selected dropdown value without submit button
body: <p>I have 2 dropdown outside the html table generated by PHP code. I have submit button in this table<br>
   as explained by following code.</p>
  
  <pre><code> &lt;!doctype html&gt;
              Select Year:
                     &lt;select name=\"year\" id=\"year\"  style="width: 200px"&gt;
                        &lt;option value=\"2014\"&gt;2014&lt;/option&gt;
                        &lt;option value=\"2015\"&gt;2015&lt;/option&gt;
                      &lt;/select&gt;
  
                  Select Trimester: 
                      &lt;select name=\"trimester\" id=\"trimester\" style="width: 200px"&gt;
                          &lt;option value=\"1st\"&gt;1st&lt;/option&gt;
                          &lt;option value=\"2nd\"&gt;2nd&lt;/option&gt;
                          &lt;option value=\"3rd\"&gt;3rd&lt;/option&gt;
                      &lt;/select&gt; 
  
  &lt;?php
       while($row = mysql_fetch_array($result)){
                        $ict_id= $row['id'];
                        $name= $row['name'];
            echo "&lt;tr&gt;&lt;form name=\"form$id\" id=\"form$id\"&gt;&lt;td&gt;".$name."&lt;/td&gt;
  
          &lt;td&gt;
            &lt;select name=\"absent$id\" id=\"absent$id\" style=\"width: 200px\"&gt;
              &lt;option value=\"1\"&gt;1&lt;/option&gt;
              &lt;option value=\"2\"&gt;2&lt;/option&gt;
            &lt;/select&gt;
          &lt;/td&gt;
  
          &lt;td&gt;
            &lt;select name=\"creative$id\" id=\"creative$id\" style=\"width: 200px\"&gt;
              &lt;option value=\"1\"&gt;1&lt;/option&gt;
              &lt;option value=\"2\"&gt;2&lt;/option&gt;
            &lt;/select&gt;
          &lt;/td&gt;
  
          &lt;td&gt;
            &lt;select name=\"problem$id\" id=\"problem$id\" style=\"width: 200px\"&gt;
              &lt;option value=\"1\"&gt;1&lt;/option&gt;
              &lt;option value=\"2\"&gt;2&lt;/option&gt;
            &lt;/select&gt;
          &lt;/td&gt;
  
      &lt;td&gt;
      &lt;input type=\"button\" name=\"submit$id\"  id=\"submit$id\" value=\"Submit\"      onclick=\"getVal(this.id)\"&gt;
  ?&gt;
  </code></pre>
  
  <p>On clicking this  button it loads following  javascript function.</p>
  
  <pre><code>function getVal(clicked_id){
  
  }
  </code></pre>
  
  <p>My problem is how can I get the selected value of year and trimester and use inside the getVal function .</p>
  
  <p>Any helps are welcomed. </p>