title: Javascript anchor href change and form post
body: <p>I have a form coded like below. Basically the href value for the anchor tag is determined by the value selected in a dropdown.</p>
  <pre><code>&lt;form name=xyz method=post&gt;
    //random stuff
  
    &lt;a href=&quot;#&quot; onclick=&quot;setAnchor()&quot;&gt;
      //some image
    &lt;/a&gt;
  &lt;/form&gt;
  </code></pre>
  <p>I am setting the href property of the form  in javascript like this:</p>
  <pre><code>if(dropdown.option selected = &quot;x&quot;)
      windows.location.href = some URL;
  else
      windows.location.href = another URL;
  </code></pre>
  <p>The problem I am having is that using <code>windows.location</code> causes the form to use the GET method. The code expects a POST method to continue.</p>
  <p>How can I fix this? I am not married to the above method. Any way I can set the form action URL, based on the option selected by the user, would work for me.</p>