title: callback after jQuery.trigger() function
body: <p>i have got a little problem here. I have to trigger an event which contains $.post() to load a form and assign it to a DOM. After this is done, i have edit the fields of the form. </p>
  
  <p>I tried:</p>
  
  <pre><code>$.when(function(){
      $('#type_rank_field').trigger('change'); //calls the $.post() to load the form
  })
   .done(function(){
      $('#quest_'+questions[i].split('|')[1]).children('option[value="'+questions[i].split('|')[0]+'"]').attr('selected',true);
  });
  </code></pre>
  
  <p>Unfortunately this doesnt work and if i leave it just like that:</p>
  
  <pre><code>$('#type_rank_field').trigger('change');
  $('#quest_'+questions[i].split('|')[1]).children('option[value="'+questions[i].split('|')[0]+'"]').attr('selected',true);
  </code></pre>
  
  <p>The change even looks like this:</p>
  
  <pre><code>        $('#type_rank_field').live('change',function(){
          var id = $(this).children('option:selected').attr('id');
          var id_edited = get_id_from_id(id);
          $.post('ajax/load_questions_of_rank.ajax.php',{id: id_edited},function(data){
              //alert(data);
              $('#rank_fields').html(data);
          });
      });
  </code></pre>
  
  <p>Then the form editation is executed before the form is properly loaded and attached to DOM. This might be a stupid question for JavaScript guys, but i am mainly a PHP guy so dont be cruel :-)</p>
  
  <p>Thanks</p>