title: Jquery show/hide div area on select
body: <p>I'm trying to return a PHP array on a selection menu.</p>
  
  <p>For example: User selects the gender inside the selection, now the JS should call a PHP class to return a array of items. And JS should add the values from the array to another selection menu.</p>
  
  <p>In case the user selects another gender now, the PHP class should be called again.</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      $(document).ready(function(){
          $('#fds_gender').change(function () {
              if ($(this).val() == "stud") {
                  &lt;?php
                      require_once('../handling/fds_categorys.php');
                      $fds_stealer = new fds_categorys($user-&gt;username, 'stud');
                      $data = $fds_stealer-&gt;get_template_categories();
                  ?&gt;
              }else if($(this).val() == "babe") {
                  &lt;?php
                      require_once('../handling/fds_categorys.php');
                      $fds_stealer = new fds_categorys($user-&gt;username, 'babe');
                      $data = $fds_stealer-&gt;get_template_categories();
                  ?&gt;
              }
          });
      });
  &lt;/script&gt;
  
  &lt;div class="col-sm-6"&gt;
      &lt;label&gt;Categories&lt;/label&gt;
      &lt;select name="categorie" data-placeholder="Select a categorie..." class="select-icons"&gt;
          &lt;?php foreach($data['categories'] as $categorie): ?&gt;
              &lt;?php echo '&lt;option value="' . $categorie['name'] . '" data-icon="woman"&gt;' . $categorie['name'] . '&lt;/option&gt;'; ?&gt;
          &lt;?php endforeach; ?&gt;
      &lt;/select&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Sadly the selection only contains the <code>else if</code> response and would not change on another selection.</p>
  
  <p>Does anyone have a idea what im doing wrong?</p>