I am trying to make an autocomplete widget that will display the name and a short description of the matched item.
For example, if I type “America” it will show “North America – The northern subcontinent of the Americas.” and “South America – The southern subcontinent of the Americas.”
I have successfully made it so my database will return the appropriate JSON response with id,value (name of the item, eg. North America, and desc (short description eg. ‘The northern subcontinent…’), I just need help to format the returned results as
<li><strong>value<strong><br><p>desc</p></li>
instead of just
<li>value</li>
Thanks a lot in advance.
P.S. I have been trying to look for an answer on Stack Overflow, but the answers I’ve found involve formatResult and other methods that are no longer supported.
http://jqueryui.com/demos/autocomplete/#custom-data – is the custom data example on the jquery ui site what you’re trying to achieve?