switch statement with Redirect
<p>Ok here's the deal, I'm trying to have a switch statement redirect to another page depending on what option is selected in a select box.  Below is a sample i'm working with and trying to figure out, any help at all would be greatly apreciated.</p>

<pre><code>    &lt;html&gt;
&lt;body&gt;
&lt;form name="form1"&gt;
&lt;select name="select1"&gt;
&lt;option value="p1"&gt;p1&lt;/option&gt;
&lt;option value="p2"&gt;p2&lt;/optino&gt;
&lt;/select&gt;
&lt;/form&gt;


&lt;script type="text/javascript"&gt;
&lt;!--
var sel = document.form1.select1;
var txt = sel.options[sel.selectedIndex].text;
var opt = sel.options[sel.selectedIndex].value;

switch (sel)
{
  case 'p1': window.location = 'http://www.yahoo.com'
            break;
  case 'p2': window.location = 'http://www.google..com'
            break;
}



&lt;/script&gt;

&lt;p&gt;Set the variable to different value and then try...&lt;/p&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>
