Trying to send visitors to another page and open specific div via onChange form event
<p>I have a page called states.php. Each state is hidden until you select it from the dropdown menu. It then shows the state div selected and hides the others. This works perfectly on the states.php page.</p>

<p>However, I have the same form on every other page on the site. I would like to be able to select a state from say, home.php, redirect them to states.php and open the correct states div.</p>

<p>Here's the form and html:</p>

<pre><code>&lt;div class="select"&gt;&lt;span class="selectState"&gt;Select a State&lt;/span&gt;&lt;span&gt;&lt;form&gt;
        &lt;select name="States" id="options" class="form-select"&gt;            
        &lt;option value="state" selected="selected"&gt;- Select a State -&lt;/option&gt;            
        &lt;option value="1" &gt;New York&lt;/option&gt;
        &lt;option value="2" &gt;New Jersey&lt;/option&gt;
        &lt;option value="3" &gt;Texas&lt;/option&gt;
         &lt;/select&gt;
        &lt;/form&gt;&lt;/span&gt;&lt;/div&gt;


&lt;!-- NY Map --&gt;
&lt;div id="state1" class="state stateShow"&gt;
NY CONTENT
&lt;/div&gt;

&lt;!-- NJ Map --&gt;
&lt;div id="state2" class="state stateShow"&gt;
NJ CONTENT
&lt;/div&gt;

&lt;!-- TX Map --&gt;
&lt;div id="state3" class="state stateShow"&gt;
TX CONTENT
&lt;/div&gt;
</code></pre>

<p>And here's the javascript:</p>

<pre><code>$(document).ready(function() {  
function optionCheck() {
var i, len, optionVal, stateDiv,
    selectOptions = document.getElementById("options");
for (i = 0, len = selectOptions.options.length; i &lt; len; i++) {
    optionVal = selectOptions.options[i].value;
    stateDiv = document.getElementById("state" + optionVal);
    if (!stateDiv) { continue; }

    if (selectOptions.options[i].selected) {
        stateDiv.className = "state stateShow";
    } else {
        stateDiv.className = "state";
    }
}    
}
document.getElementById("options").onchange = optionCheck;
});
</code></pre>

<p>And basic CSS:</p>

<pre><code>.state {
 display: none;
}
.stateShow {
  display:block;
}
</code></pre>

<p>Any help would be greatly appreciated.</p>

<p>Thanks</p>
