views:

67

answers:

1

Hi there,

I'm looking for a simple way to feed autocomplete with a dictionary and have it displayed like this:

"value_to_display": value_that_gets_inserted, eg

when one writes Pink, "Pink Floyd (England)" appears and if he chooses it, Pink Floyd gets inserted into the input field.

I have my data locally, no ajax is required so this should be easy!

var data = "One Two Three Etc".split(" ");
$("#example").autocomplete(data);

I've tried with result method but had no luck.

Can you point me to an example on how to create this?

Thank you for your time!

A: 

I have used the autocomplete on a homework i once did for a job interview. It seems like what you did should work.

i am looking at it now: http://dogself.com/homework/ (homework.js:152) looks the same as your code, other then me passing some config in

mkoryak