passing dropdown selected value to URL in javascript for an anchor tag opening window
<p>I have a drop down which has months as options.</p>

<p>Then I have an anchor tag which opens a window on click. I'm trying to pass the value of the drop down selected to the URL so that after opening the window I will retrieve it using post. </p>

<p>Here's the drop down.</p>

<pre><code>&lt;select name="datestart" id="datestart" class="form-control" style="width:500px;"&gt;
          &lt;option value=""&gt;--Select Month--&lt;/option&gt;
          &lt;option value="01"&gt;January&lt;/option&gt;
          &lt;option value="02"&gt;February&lt;/option&gt;
          &lt;option value="03"&gt;March&lt;/option&gt;
          &lt;option value="04"&gt;April&lt;/option&gt;
          &lt;option value="05"&gt;May&lt;/option&gt;
          &lt;option value="06"&gt;June&lt;/option&gt;
          &lt;option value="07"&gt;July&lt;/option&gt;
          &lt;option value="08"&gt;August&lt;/option&gt;
          &lt;option value="09"&gt;September&lt;/option&gt;
          &lt;option value="10"&gt;October&lt;/option&gt;
          &lt;option value="11"&gt;November&lt;/option&gt;
          &lt;option value="12"&gt;December&lt;/option&gt;
        &lt;/select&gt;
</code></pre>

<p>Now here's the anchor tag</p>

<pre><code>&lt;a href="#" id="detailswindow" onclick="window.open('pages/modals.php','mywindow','width=1100,height=500');"&gt;&lt;span class="glyphicon glyphicon-th-list"&gt;&lt;/span&gt; Details&lt;/a&gt;
</code></pre>

<p>This is the javascript I have so far but still not working</p>

<pre><code>&lt;script type="text/javascript"&gt;
     var datestart = document.getElementById("datestart");
     var link = document.getElementById("detailswindow");
     if(datestart.value == "01")
       {
          link.href = "pages/modals?mode=modename&amp;theme=Standard";
       }
&lt;/script&gt;
</code></pre>