title: How to preserve selected value in drop-down list after postback?
body: <pre><code>$("#county_id").change(function() {
      $("#vice_county_id").html("&lt;option value=\"\"&gt;-- Select One --&lt;/option&gt;");
      var co_id = $(this).val();
      if(co_id != 0) {
          $.getJSON('./php/includes/vice_county_web_service.php?co_id=' + co_id,function(data) {   
              $.each(data, function() {
                  $("#vice_county_id").append($("&lt;option&gt;&lt;/option&gt;").val(this['vice_county_id']).html(this['vice_county_name']));
              });
          });
      }
  });
  </code></pre>
  
  <p>Hi Guys,
  I have the above code for loading options in one drop down based on the selection in another. It works fine but to finish this up I am trying to get it to be sticky. I.e. if the form is posted and county has a value already selected then the vice county pre loads with the relevant options. Basically fire the .change functionality on load. I have tried the .load and triggerhandler functionality but it does not seem to work. Any Ideas?? Thanks.</p>