Show/Hide Function
<p>This is probably a really stupid question but I'm not familiar with JavaScript.</p>

<p>I have two different drop-down menus. If you choose the "other" option, a text box appears to write your request.</p>

<p>When I coded for the first menu, it worked. When I coded for the second one, only the second menu works, disabling the show/hide function for the first menu.</p>

<p><div class="snippet" data-lang="js" data-hide="false">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>  function showfield(name){
    if(name=='Other')document.getElementById('div1').style.display="block";
    else document.getElementById('div1').style.display="none";
  }
 
 function hidefield() {
 document.getElementById('div1').style.display='none';
 }

 function showfield(name){
    if(name=='Other')document.getElementById('div2').style.display="block";
    else document.getElementById('div2').style.display="none";
  }
 
 function hidefield() {
 document.getElementById('div2').style.display='none';
 }</code></pre>
<pre class="snippet-code-html lang-html prettyprint-override"><code> &lt;body onload="hidefield()"&gt;
   &lt;table&gt;
     &lt;tbody&gt;
           &lt;tr&gt;
                        &lt;td&gt;
                        &lt;select onchange="showfield(this.options[this.selectedIndex].value)"&gt;
                        &lt;option value=" "&gt;-- Please select --&lt;/option&gt;
                        &lt;option value="All"&gt;All&lt;/option&gt;
                        &lt;option value="Clipped"&gt;Clipped&lt;/option&gt;
                        &lt;option value="Per Post-It"&gt;Per Post-It&lt;/option&gt;
                        &lt;option value="Other"&gt;Other&lt;/option&gt;
                        &lt;/select&gt;&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td&gt;
                        &lt;div id="div1"&gt;Other: &lt;input type="text" name="other" /&gt;&lt;/div&gt;
                        &lt;/td&gt;
                    &lt;/tr&gt;
        &lt;tr&gt;
                        &lt;td&gt;
                        &lt;select onchange="showfield(this.options[this.selectedIndex].value)"&gt;
                        &lt;option value=" "&gt;-- Please select --&lt;/option&gt;
                        &lt;option value="Binding Element"&gt;Binding Element&lt;/option&gt;
                        &lt;option value="Folder/Binder"&gt;Folder/Binder&lt;/option&gt;
                        &lt;option value="Tabs"&gt;Tabs&lt;/option&gt;
                        &lt;option value="Other"&gt;Other&lt;/option&gt;
                        &lt;/select&gt;&lt;/td&gt;
                    &lt;/tr&gt;
                    &lt;tr&gt;
                        &lt;td&gt;
                        &lt;div id="div2"&gt;Other: &lt;input type="text" name="other" /&gt;&lt;/div&gt;
                        &lt;/td&gt;
                    &lt;/tr&gt;
       &lt;/tbody&gt;
     &lt;/table&gt;
   &lt;/body&gt;</code></pre>
</div>
</div>
</p>