Autosuggest results not showing

Stef's Avatar

Stef

01 May, 2011 06:26 PM

I'm using the autosuggest plugin to search a DB table of cities via PHP / AJAX. When I start typing in my text box, I can see via Firebug Console that results get returned in proper JSON format (sample below). The only problem is that they do not appear on the page. The div that is supposed to hold the results is there but stays empty, despite the fact that that search results are being outputted in proper format. So, AFAIK the problem is not the PHP part.

How can I debug this?

Returned JSON sample:
[{"response":"Brussels (Brussels, Belgium)","id":"3406_24"},{"response":"Brussels (Ontario, Canada)","id":"3451_43"},{"response":"Brush (Colorado, United States)","id":"21596_254"},{"response":"Brussels (Illinois, United States)","id":"21602_254"},{"response":"Brusly (Louisiana, United States)","id":"21601_254"},{"response":"Brusett (Montana, United States)","id":"21595_254"},{"response":"Brushton (New York, United States)","id":"21600_254"},{"response":"Brush Valley (Pennsylvania, United States)","id":"21599_254"},{"response":"Brush Creek (Tennessee, United States)","id":"21597_254"},{"response":"Brush Prairie (Washington, United States)","id":"21598_254"},{"response":"Brussels (Wisconsin, United States)","id":"21603_254"}]

JS:

`$("input#city").autoSuggest("http://localhost:8888/kms/survey/search_city", {

selectedItemProp: "response", 
selectedValuesProp: "id", 
searchObjProps: "response",

});`

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac