title: Make Postback to php file, when select value in <select>
body: <p>I'm making a website, where I should be able to delete some brands from a database, the brands is stored in categories.</p>
  
  <p>In my form, I have a  that echo's out all the categories in my database.</p>
  
  <p>The next  should then contain all brands that is within' my selected category.</p>
  
  <p>My categories contains a categoryID which is the value of the  in the first dropdown - The brands is having it's own ID, but also having the categoryID, from the category they're in.</p>
  
  <p>How would you do this? - And can you give an example, it might need javascript or jquery, which is fine with me.</p>
  
  <p>This is my code:</p>
  
  <pre><code>     &lt;form action="deleteBrand.php" method="post"&gt;
          &lt;fieldset class="delete"&gt;
          &lt;legend&gt;Delete Brand&lt;/legend&gt;
          &lt;div&gt;
          &lt;label for="categoryid"&gt;Category:&lt;br /&gt;
          &lt;?php
              $stmt = $db-&gt;prepare("SELECT categoryid, category FROM categories");
              $stmt-&gt;execute();
              echo "&lt;select name='categoryid' onchange='this.form.submit()'&gt;";
              while ($row = $stmt-&gt;fetch(PDO::FETCH_ASSOC)) {
                  echo "&lt;option value='{$row['categoryid']}'&gt;{$row['category']}&lt;/option&gt;";
              }
              echo "&lt;/select&gt;";
          ?&gt;
          &lt;/label&gt;
          &lt;/div&gt;
          &lt;div&gt;
          &lt;label for="brand"&gt;Brand Name:&lt;br /&gt;
          &lt;?php
  
              $stmt = $db-&gt;prepare("SELECT brands.id, brand FROM brands WHERE brands.categoryid = ")
          ?&gt;
          &lt;/label&gt;
          &lt;/div&gt;
          &lt;div&gt;
          &lt;input type="submit" value="Delete Brand" /&gt;
          &lt;/div&gt;
          &lt;/fieldset&gt;
          &lt;/form&gt;
  </code></pre>
  
  <p>I'm still missing the last dropdown, but if I just can get the value from the selected item from the first dropdown, into a variable, it shouldn't be hard for the rest of the code!</p>
  
  <p>Thank you a lot</p>