JQuery: variable from .change not showing up in .load
<p>I'm setting up dynamic pulldowns: the choice on select#category informs the contents of select#subcat.</p>

<p>this is the html for select#category:  </p>

<pre><code>&lt;select name="category" id="category"&gt;
    &lt;option&gt;Click Here to choose a category&lt;/option&gt;
           &lt;?php foreach ($categories as $key =&gt; $category) { ?&gt;
    &lt;option value="&lt;?php echo $key ?&gt;"&gt;&lt;?php echo $category ?&gt;&lt;/option&gt;
           &lt;?php } ?&gt;         
&lt;/select&gt;

&lt;select name="subcat" id="subcat"&gt;
    &lt;option&gt;&amp;lt;-- First Choose a Category&lt;/option&gt;                           
&lt;/select&gt;
</code></pre>

<p>this is the jQuery statement:</p>

<pre><code>$(document).ready(function(){
    $("select#category").change(function(){
        $("select#subcat").load("subcats.php",{ id: $(this).val(), ajax: 'true'});
    });
});
</code></pre>

<p>this is subcats.php:</p>

<pre><code>&lt;?php
      //source of categories
      include("config.php") ;
      //initiate option list
      $options =  '&lt;option value=""&gt;Choose a Sub-category&lt;/option&gt;'."\n" ;
      if(!empty($_GET["id"])) {
      //iterate through the categories
      foreach ($categories as $key =&gt; $category) {
      if ($_GET["id"] == $key) {
      //select the data source
      $subcats = file('subcat/'.$key.'.dat', FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES) ;
      natsort($subcats);
      //create the rest of the option list
          foreach ($subcats as $subcat) {
          list ($subname,$subkey ) =explode ("\t", $subcat) ;
           $options .=  '&lt;option value="'.$subkey.'"&gt;'.$subname.'&lt;/option&gt;'."\n" ;
      }
      echo  $options ;   
          }
      }
      }  else {
      // if no variable given provide option list as error check
      echo  '&lt;option value=""&gt;&amp;lt;-- Choose a Category First&lt;/option&gt;
      &lt;option value=""&gt;Foo Bar&lt;/option&gt;'."\n" ;   
          }
      ?&gt;
</code></pre>

<p>My understanding is that <code>id: $(this).val()</code> provides the selected option from <code>select#category</code> for use in the php document; am I off base here? Really, if I'm reading the docs right, I shouldn't even need the <code>, { id: $(this).val(), ajax: 'true'}</code> bit
the ajax request <code>.load</code> is working, because the error check menu items appear in the <code>select#subcats</code>.</p>

<p>However, that's all that appears: the variable does not seem to be getting through...</p>

<p>Li'l help here? Thanks in advance!</p>
