I have a plugin of auto complete which takes 3 parameters
$(function(){
setAutoComplete("id", "results", "url");
});
Now i am trying to use it on multiple text boxes where there are different urls to fetch data from but its not working. if i use it on a single text box its working.
I have done this in javascript
$(function(){
setAutoComplete("searchField1", "results", "url1");
});
$(function(){
setAutoComplete("searchField2", "results", "url2");
});
$(function(){
setAutoComplete("searchField3", "results", "url3");
});
But still it is not working.
Help required.
Instead of using multiple functions try this.
Assign a class to all the input fields on which you want autocomplete to appear. LEt say the class name is autocomplete.
Then use a single function