title: Two autocomplete, on two inputs (differnet id), on same page
body: <p>So I have two textfields on my page, img and lok. I want them both to have a autocomplete with data from another page that uses input-value as search string. The script that comes first in code works as it should. The next is never executed. If I changes order it works for the other input, so both works by them self. So I will have to make some function name to make them different? Here is my code:</p>
  
  <pre><code>&lt;script&gt;
  $(function () {
              $("#img").autocomplete({
                  minLength: 3,
                  source: function (request, response) { 
                      $.ajax({ 
                          url: "q/qfolder.php", 
                          dataType: "json", 
                          data: {
                              q: $("#img").val(),  
                          }, 
                          success: function (data) { 
                              response(data); 
                          } 
                      }); 
                  },
              })
              .data("autocomplete")._renderItem = function (ul, item) {
                  return $("&lt;li&gt;&lt;/li&gt;")
                      .data("item.autocomplete", item);
              };
          });
  &lt;/script&gt;
  &lt;script&gt;
  $(function () {
              $("#lok").autocomplete({
                  minLength: 2,
                  source: function (request, response) { 
                      $.ajax({ 
                          url: "q/qlok.php", 
                          dataType: "json", 
                          data: {
                              q: $("#lok").val(),  
                          }, 
                          success: function (data) { 
                              response(data);
                          } 
                      }); 
                  },
              })
              .data("autocomplete")._renderItem = function (ul, item) {
                  return $("&lt;li&gt;&lt;/li&gt;")
                      .data("item.autocomplete", item);
              };
          });
  &lt;/script&gt;
  
  &lt;input type="text" id="lok"&gt;
  &lt;input type="text" id="img"&gt;
  </code></pre>
  
  <p>The JSONs is one dimentional, so quiet simple responses. Have read a lot of treads that was quite similar, but none resolved my problem. Sadly I have very little experience with jQuery.</p>