title: Changing the source of an autocomplete widget
body: <p>I have a strange problem with a jquery autocomplete widget.
  First I have a 'select' HTML element which displays all the projects.
  I also have an input element in which I can search for questionnaires which correspond to the selected project.</p>
  
  <p>So I have this code : <a href="http://jsfiddle.net/AMkKX/1/" rel="nofollow">http://jsfiddle.net/AMkKX/1/</a></p>
  
  <p>Everything works great. But my problem is when I refresh the page (with F5, not Ctrl+F5) : the previous choice of the select box is always selected so I want to change the source of the autocomplete widget (the code I show you should do that)</p>
  
  <p>But the source doesn't change unless I put an alert before <code>$('#search-questionnaire').autocomplete('option', 'source', data);</code> :</p>
  
  <pre><code>$('#search-project').change(function () {
      var data;
      var val = $(this).val();
  
      alert('val : ' + val);
  
      if (val != '')
          data = questionnairesData[val];
      else
          data = allQuestionnairesData;
  
      $('#search-questionnaire').autocomplete('option', 'source', data);
  });
  </code></pre>
  
  <p>So I don't understand. Is it a bug ?</p>
  
  <p><strong>EDIT :</strong> I can't show you the 'F5 refresh' thing with jsfiddle. If you want to test it you have to copy the code and use it in your navigator.</p>