I have been experimenting with the autocomplete plugin. It is great. Loading data from a database once and then using it works just fine. In my setup the html file calls a database query and returns a comma seperated string. The string is then split up and any typing in the street input textbox shows the results in kind of like a selectbox under it. The results are seperatedly selectable. Works fine. I use the autocomplete.css, bgiframe.js, dimensions.js, and autocomplete.js files. I do it like this:
$(document).ready(function() { $.post("streetnames.html",function(data,text) { var txt = data.split(","); $("#street").autocomplete(txt); }); }); Now I wanted a dynamically populated search box. Then I started on sending requests with a parameter to the server. I looked at the demo page and found several examples and options to use, but I can't find a separate list of options and their explanation, I would like to. Now I have some trouble with the results. The html file receives the parameter put in the input box and returns again a string, comma separated. The data returned are OK and the filtering works dynamically. The problem now is that the results are just crammed into the resultbox and I can only select the first result. I am using the same files as above. What am I missing here? The code goes like this: $(document).ready(function() { function formatResult(data,value) { txt = value.split(","); return txt[0]; } $("#street").autocomplete("streetnames2.html",{width: 300,selectFirst:false,formatResult: formatResult}); });