title: PHP dropdown selection populates a text area with info
body: <p>I have been trying to figure out a piece of code to answer the following question.</p>
  
  <p>I have a ticketing site that has a dropdown that users select what departement they want their ticket to go to,  I need it to populate the text area with a few things (asking them to include their id, location, supervisor etc)</p>
  
  <p>My code for the dropdown is:</p>
  
  <pre><code>     &lt;/tr&gt;
  &lt;tr height=2px&gt;&lt;td align="left" colspan=2 &gt;&amp;nbsp;&lt;/td&lt;/tr&gt;
  &lt;tr&gt;
      &lt;th&gt;Department:&lt;/th&gt;
      &lt;td&gt;
          &lt;select name="deptId" onChange="getTopic('findtopic.php?topic_id='+this.value)"&gt;
              &lt;option value="" selected &gt;Select Department&lt;/option&gt;
              &lt;?
               $services= db_query('SELECT dept_id,dept_name FROM '.DEPT_TABLE.' ORDER BY dept_name');
               while (list($deptId,$dept) = db_fetch_row($services)){
                  $selected = ($info['deptId']==$deptId)?'selected':''; ?&gt;
                  &lt;option value="&lt;?=$deptId?&gt;"&lt;?=$selected?&gt;&gt;&lt;?=$dept?&gt;&lt;/option&gt;
              &lt;?
               }?&gt;
          &lt;/select&gt;
          &amp;nbsp;&lt;font class="error"&gt;&lt;b&gt;*&lt;/b&gt;&amp;nbsp;&lt;?=$errors['deptId']?&gt;&lt;/font&gt;
      &lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>The code for the text area is:</p>
  
  <pre><code>    &lt;tr&gt;
      &lt;th valign="top"&gt;Message:&lt;/th&gt;
      &lt;td&gt;
          &lt;? if($errors['message']) {?&gt; &lt;font class="error"&gt;&lt;b&gt;&amp;nbsp;&lt;?=$errors['message']?&gt;&lt;/b&gt;&lt;/font&gt;&lt;br/&gt;&lt;?}?&gt;
          &lt;textarea name="message" cols="35" rows="8" wrap="soft" style="width:85%"&gt;&lt;?=$info['message']?&gt;&lt;/textarea&gt;
      &lt;/td&gt;
  &lt;/tr&gt;
  </code></pre>
  
  <p>My hope is that I can set something in motion so when a user selects a "access requests" from the dropdown (which in the mysql db is "9" in the depts list) that the text area will auto populate with a list of things required of the users.  </p>
  
  <p>I am brand new to coding and got the site up and running (with a load of help from OSTICKET forums) but am stumped by this one.</p>
  
  <p>If you need any other data, let me know.</p>
  
  <p>fireballbrady</p>