title: Drop down menu to remember selection and redirect user
body: <p>I am making a landing page with a drop down menu which will redirect users to a new directory. </p>
  
  <p><a href="http://steerbox.com/countryselect/" rel="nofollow">http://steerbox.com/countryselect/</a> </p>
  
  <p>That part is working and now I need to add code to set a cookie when the country is selected, so that the next time the user visits the landing page they will automatically get redirected to that country's directory without having to select from the drop down menu again. </p>
  
  <p>I have found jquery and javascript which will set the cookie on selection of the drop down, but I can't seem to get the drop down to both set the cookie and still redirect the user. Following is the script that I am currently using for the drop down and redirect:</p>
  
  <pre><code>&lt;Script language="JavaScript"&gt;
  function goto(form) { var index=form.select.selectedIndex
  if (form.select.options[index].value != "0") {
  location=form.select.options[index].value;}}
  &lt;/SCRIPT&gt;
  &lt;FORM NAME="form1"&gt;
  &lt;SELECT NAME="select" ONCHANGE="goto(this.form)" SIZE="1"&gt;
  &lt;OPTION VALUE=""&gt;Select Country
  &lt;OPTION VALUE="chile"&gt;Chile
  &lt;OPTION VALUE="colombia"&gt;Colombia
  &lt;OPTION VALUE="bolivia"&gt;Bolivia
  &lt;/select&gt;
  &lt;/FORM&gt;
  </code></pre>
  
  <p>Thanks! Dean</p>