title: using jquery-ui autocomplete with multiple input fields
body: <p>good afternoon all!</p>
  
  <p>i spared a lot of time, read all posts on stackoverflow... and i am not able to make autocomplete working with multilpe input fields. 
  I tried to attrib a 'autoc' class to each input, i use a different id for each field (in fact the inedx of the php loop generating fields).
  I do not ask someone to do the job for me.... just a working example.</p>
  
  <p>Thanks in advance.</p>
  
  <p>PS : I apologize for my poor english...</p>
  
  <p>now follows a piece of html :</p>
  
  <pre><code>    &lt;input id="search_ctO" class="autoc" type="text" name="search_ct[]"&gt;
      &lt;input id="search_ct1" class="autoc" type="text" name="search_ct[]"&gt;
      &lt;input id="search_ct2" class="autoc" type="text" name="search_ct[]"&gt;
      ....
      &lt;input id="search_ctn" class="autoc" type="text" name="search_ct[]"&gt;
  </code></pre>
  
  <p>and jquery :</p>
  
  <pre><code>    $('.autoc').on("focus", function()   
        $(this).autocomplete({
         minLength: 2,
         source: 'liste_contact.php',
         select: function( event, ui ) {  
           $('.autoc #search_ct').val( ui.item.label ); //id="search_ct'.$i.'
           $(".autoc #contact_id").val( ui.item.value ); //
           $("autoc #contact_description").val( ui.item.desc );
           return false;
         },  
        change: function(){ 
           var servi = $("#service_id").val();
           var hop = $('#hop').val();
           var contact = $("#contact_id" ).val();
           $.ajax({
             url: 'ajout_contact.php',
             data: "serv="+ servi+"&amp;hopit=" + hop+"&amp;contact="+ contact+"",// on envoie la requete d'ajout de contact
  
           success: function() {
                 $("#search_ct").val('');
                 // location.reload(true);         
         }
  </code></pre>