Jump to content

Auto complete text using JSON


sridaran

Recommended Posts

I am trying auto complete text using json file. But only last data is getting displayed. Can anyone tell me where I did mistake? autocomplete.json {"label" : "Aragorn","label" : "Arwen","label" : "Bilbo Baggins","label" : "Boromir","label" : "Frodo Baggins","label" : "Gandalf","label" : "Gimli","label" : "Gollum","label" : "Legolas","label" : "Meriadoc Merry Brandybuck","label" : "Peregrin Pippin Took","label" : "Samwise Gamgee"} index.html<html><body><div class="ui-widget"><input id="tags" /><script>$(function() {$( "#tags" ).autocomplete({source:"autocomplete.json"})});</script></div></body></html>

Link to comment
Share on other sites

There can only be one property called "label". Each "label" is overwriting the previous one. Maybe you should check the documentation for the data format again to make sure you didn't misunderstand.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...