title: Populate checkbox list depending on dropdown selection
body: <p>I am creating a form that will populate a div with checkboxes related to media files that a usergroup has uploaded. Basically, if the user selects the name of the group from a dropdown menu, all associated media files will appear in a div in checkbox form.</p>
  
  <p>The dropdown menu receives it's options from the database, the options will not always be a known quantity. </p>
  
  <pre><code>&lt;select name="gpname" id="gpname"&gt;
  &lt;option value=""&gt;&lt;/option&gt;
  &lt;?php
  $results = mysql_query("SELECT * FROM usergroups ORDER BY groupname");            
  while($row = mysql_fetch_array($results)) {
       echo ('&lt;option value="'); echo ($row['groupname']); echo('"&gt;'); echo $row['groupname']; echo('&lt;/option&gt;');
  }; ?&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>Then, here is the div:</p>
  
  <pre><code>&lt;div style="overflow: auto; width: 500px; height: 100px; border: 1px solid #c4c4c4; padding-left: 5px" id="medialist"&gt;&lt;/div&gt;
  </code></pre>
  
  <p>What would be the best way to go about this?</p>