title: display a textbox if user select "Other" on the drop down menu retrieved from the database
body: <p>pls help me with this one. I can't display the textbox if the user selects "Other" option in the drop down menu. the values in the drop down came from the database. thanks! :)</p>
  
  <pre><code> &lt;th align="left" height="26" colspan="3"&gt;&lt;strong&gt;Return Reason Codes:&lt;/strong&gt;&lt;span class="select"&gt;
        &lt;?php
  
              echo "&lt;select description='returnreason' type='text' id='returnreason' onchange=' showfield(this.options[this.selectedIndex].value)'&gt;";
              echo '&lt;option id="0"&gt;'.'    --Select Return Reason--  '.'&lt;/option&gt;';
              $sql = mysql_query("SELECT * FROM preturnreason");
              while($record = mysql_fetch_assoc($sql)) 
                     {
                      echo '&lt;option value=" '.$record['DESCRIPTION'].'"&gt;'.$record['DESCRIPTION']. '&lt;/option&gt;';
  
                     }        
              echo '&lt;/select&gt;';
  
           ?&gt; &lt;div id="div1"&gt;&lt;/div&gt;&lt;/th&gt;
      &lt;/tr&gt;
  </code></pre>
  
  <p>and here's my javascript:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  function showfield(name){
    if(name=='Other')document.getElementById('div1').innerHTML='Other: &lt;input type="text" name="other" /&gt;';
    else document.getElementById('div1').innerHTML='';
  }
  &lt;/script&gt;
  </code></pre>