JS show hide feild diappear when clicking submit
<p>I have a php form which has a dropdown list and a text which show and hide based on drop down list value. The problem is when I click submit button and there is validation error the onload function work and the text hide ,,, it should stay visible or invisible depending on the drop down list.</p>

<p>Here is what Im doing:</p>

<pre><code>&lt;script type="text/javascript"&gt;

    function showfield(name){
    if(name != 'High School')
    document.getElementById('div1').style.display="block";
    else 
    document.getElementById('div1').style.display="none";
  }

  function hidefield() {
    document.getElementById('div1').style.display='none';
 }
&lt;script&gt;
</code></pre>

<p>Im calling the hidefield function here on body on load:</p>

<pre><code>&lt;body onload = "hidefield()"&gt;
</code></pre>

<p>and the other function on the drop downlist </p>

<pre><code>&lt;select name="education" size="1" class="text" id="education" onchange="showfield(this.options[this.selectedIndex].value)"&gt;
</code></pre>

<p>Hope some one can help.</p>
