How to change content in div based on dropdown list

I am loading my content from mine DBusing PHPin my div.

I have dropdownover it where I should be able to sort the content, which means that when I select the dropdownold content in it divis deleted, and the new one appears.

So, how can you β€œdelete” old content in divand get new content based on dropdown selection?

This is what I got so far:

    <div class="col-md-4">
          <ul class="nav nav-tabs top_nav">
            <li role="presentation" class="active"><a href="#">Edit</a></li>
            <li role="presentation" class="inactive">

              <!-- THE DROPDOWN THAT SHOULD SORT THE CONTENT BELOW -->
              <!-- REMOVE OLD, AND GET NEW AFTER SELECTED -->

                <select id="filter_type">
                    <option selected value="Alle">Alle</option>
                    <option value="Privat_Tale">Privat Tale</option>
                    <option value="Erhverv_Tale">Erhverv Tale</option>
                    <option value="Gamle">Gamle</option>
                    <option value="Privat_MBB">Privat MBB</option>
                    <option value="Erhverv_MBB">Erhverv MBB</option>
                    <option value="Familietele">Familietele</option>
                    <option value="Retention">Retention</option>
                </select>
            </li>
          </ul>

  <!-- LOAD THE CONTENT FROM DB, AND SHOW IT -->

            <div class="abo_load" id="abo_load">
            <?php
if (mysql_num_rows($sql_select_edit) > 0) {
    while ($row = mysql_fetch_assoc($sql_select_edit)) {
?>
        <div class="abo_box" id="abo_box">
         <label class="abo_navn"><?php echo $row['abo_name']; ?></label>
         <input type="hidden" value="<?php echo $row['category']; ?>" name="category" />
         <form action="conn/delete.php" method="post">
          <input type="hidden" value="<?php echo $row['id'];
?>" name="slet">
          <input class="delete" value="Delete" type="submit" onclick="return confirm('Er du sikker??\nDet ville jo være ÆV med en Fejl 40!');">
         </form>
         <label class="edit">Edit</label>
         <?php include("files/edit_list_content.php"); ?>                                                       
       </div>                            
      <?php
    }
}
?>
            </div>
      </div>

EDIT: JQuery, php, , . , JQuery . , JQuery. , , php , , , JQuery. , php

+4

All Articles