Javascript sticky dependant dropdown
<p>I asked a question regarding this problem about a few hours back and have noticed that this still isn't working correctly.</p>

<p>What I need is to show a textbox to the user if they select a two of the three choices. When the user clicks the submit button the dropdown needs to maintain the value chosen. I can do this with my application code but where the javascript fails is that the hidden div, even though it has a value that is dependent on the textbox being shown, will no longer show. It's because of the pager refresh.</p>

<p>Here is my code. Can someone please tell me what I need to change so that the textbox will reappear after a refresh IF a value other than "NONE" is selected?</p>

<pre><code>function toggleTbox(chosen)
{
    var hide = document.getElementById("otherValues");
    if (chosen == 'PHASE1') {
        hide.style.display = 'block';
    } else if(chosen == 'PHASE2') {
        hide.style.display = 'block';
    } else {
        hide.style.display = 'none';
    }
}
</code></pre>

<hr>

<pre><code>&lt;tr&gt;
  &lt;td&gt;
    &lt;label for="sales"&gt;Sales:&lt;/label&gt;&lt;br /&gt;
    &lt;select name="sales" onchange="toggleTbox( document.salesEntry.salesEntry.options[ document.salesEntry.rxGateway.selectedIndex ].value );"&gt;
    &lt;option value="[server]"&gt;[server]&lt;/option&gt;
    &lt;option value="NONE"&gt;NONE&lt;/option&gt;
    &lt;option value="PHASE1"&gt;PHASE1&lt;/option&gt;
    &lt;option value="PHASE2"&gt;PHASE2&lt;/option&gt;
    &lt;/select&gt;
  &lt;/td&gt;
  &lt;td&gt;
    &lt;div id="otherValues" style="display:none"&gt;
       &lt;label for="salesNumber"&gt;Sales No&lt;/label&gt;&lt;br /&gt;
       &lt;input type="text" name="salesNumber" id="salesNumber" value="[server]" /&gt;
    &lt;/div&gt;
  &lt;/td&gt;
&lt;/tr&gt;
</code></pre>
