jQuery Autocomplete for multiple input fields <p>Hey guys, I've downloaded an auto-complete script in jQuery from formvega (http://www.fromvega.com) and I've encountered a problem. I want to make this work for several input fields and I've tried to make it work buy linking it to input classes. The problem is that when I do so it the first form fills all the other forms with the same content. I guess it's some problem with the variables in .js-file but I canät seem to figure out what it is. </p> <p>Here is some code form the .js file:</p> <pre><code>var acListTotal = 0; var acListCurrent = -1; var acDelay = 500; var acURL = null; var acSearchId = null; var acResultsId = null; var acSearchField = null; var acResultsDiv = null; function setAutoComplete(field_class, results_id, get_url ){ // initialize vars acSearchId = "." + field_class; acResultsId = "#" + results_id; acURL = get_url; // create the results div $("body").append('&lt;div id="' + results_id + '"&gt;&lt;/div&gt;'); // register mostly used vars acSearchField = $(acSearchId); acResultsDiv = $(acResultsId); // reposition div repositionResultsDiv(); </code></pre>