title: Trigger onchange html event on page load too
body: <p>Ok I have a onchange event on a select field.  It now works great.  When the dropdown "networks" is changed it refreshes the second dropdown.  I also want the ajax code at the top to trigger on page load as well as onchange so the second list gets populated.  This is due to it being on an edit page.  Here is the ajax call im using first</p>
  
  <pre><code>function get_cities(networks) {
      $.ajax({
          type: "POST",
          url: "select.php", /* The country id will be sent to this file */
          beforeSend:     function () {
              $("#folder").html("&lt;option&gt;Loading ...&lt;/option&gt;");
          },
          //data: "idnetworks="+networks,
          data: "idnetworks="+networks +"&amp;doc="+ &lt;?php echo $row_rs_doc['parentid']; ?&gt;,
          success: function(msg){
              $("#folder").html(msg);
          }
      });
  } 
  </code></pre>
  
  <p>now the two dropdown boxes</p>
  
  <pre><code>&lt;label for="networks"&gt;&lt;/label&gt;
  &lt;select name="networks" id="networks" onChange='get_cities($(this).val())'&gt;
      &lt;?php
      do {  
      ?&gt;
          &lt;option value="&lt;?php echo $row_rs_net['idnetworks']?&gt;"&lt;?php if (!(strcmp($row_rs_net['idnetworks'], $row_rs_doc['network']))) {echo "selected=\"selected\"";} ?&gt;&gt;&lt;?php echo $row_rs_net['netname']?&gt;&lt;/option&gt;
      &lt;?php
      } while ($row_rs_net = mysql_fetch_assoc($rs_net));
      $rows = mysql_num_rows($rs_net);
      if($rows &gt; 0) {
          mysql_data_seek($rs_net, 0);
          $row_rs_net = mysql_fetch_assoc($rs_net);
      };
      ?&gt;
  &lt;/select&gt;
  &lt;select name="folder" id="folder"&gt;
  &lt;/select&gt;
  </code></pre>