SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Guru downtroden's Avatar
    Join Date
    Dec 2004
    Location
    illinois
    Posts
    972
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    jquery ui autocomplete list only showing 'undefined'

    Is it just looking for the default label:value items in the json to put in the list? Is there a way to specify what you want in the list as the label and value?

    I've looked over the ui docs for it, but can't seem to find an answer, that or I don't know what I should be looking at.

    I've got it working (populating the list with correct number of values, putting values in the field after select), it just doesn't display the options correctly.

    Thanks for any assistance on this.
    your brain reacts in the same way whether you are
    looking at something or thinking about it...

  2. #2
    SitePoint Member
    Join Date
    Jul 2010
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can return whatever you want in the JSON, but autocomplete will look for label and value. Can you add the "label" key to your response?

  3. #3
    SitePoint Guru downtroden's Avatar
    Join Date
    Dec 2004
    Location
    illinois
    Posts
    972
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    So, here's the response from the server

    Code:
    [{"user":{"value":2,"label":"whole name"}},{"user":{"value":5,"label":"user whole name"}}]
    The whole name value is for example purposes. What I'm not understanding is why this isn't working.
    your brain reacts in the same way whether you are
    looking at something or thinking about it...


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •