Jquery not functioning correctly (not waiting?)
<p>Here is my javascript:</p>

<pre><code>  $('#Service').val("2");
  $("#Service").change(); // Sets new options in subservice.
  $('#Subservice').val("5");
  //EDIT:
  alert($('#Subservice').length); // Returns 1, when there are far more in it.
</code></pre>

<p>Service and Subservice are drop down boxes.</p>

<p>On Service change, the new list of subservices is populated.</p>

<p>This is setting the fields of the record to be editted. It executes when I click an Edit Button. 
It sets the service dropdownbox, then is populating the subservice dropdown box, then attempting to set the correct dropdown selection for it.</p>

<p>However it is not correctly setting the subservice box. The options are correct, so <code>.change()</code> is working and service sets correctly. However Subservice is not being set. And there is an entry with value 5 in it. </p>

<p>My only reasoning is that .change is firing, but carrying on to setting .val before it finishes. And so no options exist at the time of setting. However I dont see why it would be threading either. So Im not sure what is going on or how to fix it.</p>
