Replies(11)

I'm trying to make the autocomplete working, using remote data from an access db.

I get the right data back from call, but no select box is showing up.

I only get the text "2 results are available, use up and down arrow keys to navigate." outside the input field and behind that text the recieved data is poping up like a mess. When I click the data it moves to the input.

So I wonder: Where does this text come from and how do I get rid of it. And why dont the selectbox show up?

2 results are available, use up and down arrow keys to navigate." outside the input field and behind that text the recieved data is poping up like a mess. When I click the data it moves to the input. So I wonder: Where does this text come from and how do I get rid of it. And why dont the selectbox show up?

You're using the source: option to send data to your server. This can work, but the data: option is intended to do this, especially for several pieces of data. So something like

data: { seekstr: $("#namn").value(), dum: Math.random() }

Is there a reason to put the Autocomplete inside an an anonymous function - that you can't call from elsewhere in the code? I would remove the function - 1st and last lines of your posted code.

The data example (Test1, Test2) is not JSON. Have you copied the server's response out of the Console in Firebug or Chrome Developer Tools, pasted it into jsonlint.com and validated that your server produces JSON?

I don't follow your server code. BTW, it is vulnerable to hacks. Assume your data will be hacked.Here's some PHP that generates JSON. If you modify and use something like this, you will need to add an option to the Autocomplete code to tell it that it will receive JSON. dataType: JSONThe tutorial I referred you to describes more.Here's PHP code to generate JSON for Autocomplete