Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7436447
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T10:14:28+00:00 2026-05-29T10:14:28+00:00

I need to implement an Autocomplete functionality which display names and faces like in

  • 0

I need to implement an Autocomplete functionality which display names and faces like in the Facebook autocomplete.
In this post Jquery UI autocomplete – images IN the results overlay, not outside like the demo and in the demonstration which was in that post http://jsfiddle.net/K5q5U/ I found an excellent way to do this.
the demonstration uses StackOverflow’s API for searching users, and shows their avatars to the left of them.
but the problem is that it is working well only when one input field is presented, when I tried to change it to several input fields only the first field displayed the images+ text, the second field ignored from the image and displayed only the autocomplete text.
(I get the input fields from a database and I dont now what is the number of the fields in advanced)

here is the code that i use

<input class="auto" type="text" />
<input class="auto" type="text" />

$(document).ready(function () {
    $(".auto").autocomplete({
        source: function (request, response) {
            $.ajax({
                url: "http://api.stackoverflow.com/1.1/users",
                data: {
                    filter: request.term,
                    pagesize: 10
                },
                jsonp: "jsonp",
                dataType: "jsonp",
                success: function(data) {
                    response($.map(data.users, function(el, index) {
                        return {
                            value: el.display_name,
                            avatar: "http://www.gravatar.com/avatar/" +
                                el.email_hash
                        };
                    }));
                }
            });
        }
    }).data("autocomplete")._renderItem = function (ul, item) {
        return $("<li />")
            .data("item.autocomplete", item)
            .append("<a><img src='" + item.avatar + "' />" + item.value + "</a>")
            .appendTo(ul);
    };    
});

any help which can tell me how I can adjust it, so the custom image+text autocomplete will be displayed in several fields will be very appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T10:14:28+00:00Added an answer on May 29, 2026 at 10:14 am

    Maybe it’s a bug. Try this workaround:

    $(".auto").each(function() {
    
      $(this).autocomplete({    
        // put here remaining code
    
    
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When the class with a member which is a pointer, we need implement a
I'd like to implement a simple AJAX function locally that allows me to autocomplete
I need implement a Data entry like receiver field in mail app (Ex. To:
I'm running a Rails 3 app, where I have a jQuery autocomplete box, which
I need implement simple search in small content table: id, name, description, content. Results
I need to implement a large collection of Widget objects, each of which contain
I need to implement a special ZLib implementation which should run under .Net and
I'm trying to implement JQuery UI's Autocomplete feature into a div that is initially
I am trying to implement this jQuery auto complete function but the problem is
Need to implement Image processing effects like Blur, Black & White, Pinch Zoom in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.