issue with Chained Selects
===

I am using [Mika Tuupola Chained Selects jQuery plugin][1] to build a chained select.


  [1]: http://www.appelsiini.net/projects/chained

I am dynamically pulling the options from two databases categories and subcategories like this:

categories:

    <?php
      $query="SELECT * FROM categories";
      $result = mysql_query ($query);
   	  echo"<select name='cselect1' id='cat'><option value=''>Please Select A Category</option>";
      // printing the list box select command
      while($catinfo=mysql_fetch_array($result)){//Array or records stored in $nt
      echo "<option value=\"".htmlspecialchars($catinfo['number'])."\">".$catinfo['cat']."</option>";

      }

      echo"</select>";
    ?>

and subcategories

    <?php
      $query="SELECT * FROM subcategories";
      $result = mysql_query ($query);
   	  echo"<select name='sselect1' id='subcat'><option value=''>Sub Category</option>";
      // printing the list box select command
      while($catinfo=mysql_fetch_array($result)){//Array or records stored in $nt
      echo "<option value='".htmlspecialchars($catinfo['subcat'])."' class='".$catinfo['catnumber']."'>".$catinfo['subcat']."</option>";
      }

      echo"</select>";
    ?>
which echos out something like this:

  

    <select id="cat" name="cselect1">
        <option value="0">Please Select A Category</option>
        <option value="1">Restaurants</option>
        <option value="2">Food</option>
        <option value="3">Nightlife</option>
        <option value="4">Shops</option>
    </select>

    <select id="subcat" name="sselect1">
        <option value="">Sub Category</option>
        <option class="1" value="American">American</option>
        <option class="2" value="Specialty Food">Specialty Food</option>
        <option class="3" value="Bars">Bars</option>
        <option class="4" value="Computers">Computers</option>
    </select>

and here is my jquery:

    <script src="http://code.jquery.com/jquery-latest.min.js" type="text/javascript"></script>
    <script src="../public/scripts/chain.js" type="text/javascript"></script>
    <script type="text/javascript">
        	$("#subcat").chained("#cat");
    </script>
But for some reason, it's not working? Why is this? 

Thanks for all help on this! 