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

  • SEARCH
  • Home
  • 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 8652505
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:19:19+00:00 2026-06-12T14:19:19+00:00

I am getting an error in this code. Can anybody help me? <h4>search:<input type=text

  • 0

I am getting an error in this code. Can anybody help me?

<h4>search:<input type="text" id="name-list" /></h4>
<script type="text/javascript" language="javascript">
$(function () {
        $("#name-list")
    .autocomplete({
        source: function (request, response) {
                $.ajax({
                url: "/Home/Searchuser", type: "POST", dataType: "json",
                data: { searchText: request.term, maxResults: 10 }
            })

            return false;

        },

        minLength: 1

        }).data("autocomplete")._renderItem = function (ul, item) {
        var inner_html = '<a><div class="list_item_container"><div class="image"><img src="' + item.PicLocation + '"></div><div class="label">' + item.label + '</div><div class="description">' + item.DisplayName + '</div></div></a>';
                                 return $("<li></li>")
                                .data("item.autocomplete", item)
                                .append(inner_html)
                                .appendTo(ul);
    };

    });
</script>

The data is receiving correctly from the server. Where have i made mistake?

  • 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-06-12T14:19:20+00:00Added an answer on June 12, 2026 at 2:19 pm

    @ JoeFletch Thanks for your help.

    I made these changes to the code and then it worked well.
    Here are some css i used.

    <style type="text/css">
    DIV.list_item_container {
    height: 90px;
    padding: 0px;
        }
        DIV.image {
    width:90px;
    height: 90px;
    float: left;
        }
        DIV.description {
    font-style: italic;
    font-size: 1.1em;
    color: gray;
    padding: 5px;
    margin: 5px;
        }
    
    #name-list
    {
        width: 300px;
    
    
        }
    </style>
    

    Here is my script

    $(document).ready(function () {
            $('#name-list').autocomplete({
                source: function (request, response) {
                    $.ajax({
                        url: "/Home/Searchuser",
                        data: { searchText: request.term, maxResults: 10 },
                        dataType: "json",
                        success: function (data) {
    
                            response($.map(data, function (item) {
                                return {
                                    value: item.DisplayName,
                                    avatar: item.PicLocation,
                                    rep: item.Reputation,
                                    selectedId: item.UserUniqueid
                                };
                            }))
                        }
                    })
                },
                select: function (event, ui) {
    
                                     alert(ui.item ? ("You picked '" + ui.item.label)
                                                              : "Nothing selected, input was " + this.value);
    
                    return false;
                }
            }).data("ui-autocomplete")._renderItem = function (ul, item) {
                var inner_html = '<a><div class="list_item_container"><div class="image"><img src="' + item.avatar + '"></div><div class="label"><h3> Reputation:  ' + item.rep + '</h3></div><div class="description">' + item.label + '</div></div></a><hr/>';
                return $("<li></li>")
                        .data("ui-autocomplete-item", item)
                        .append(inner_html)
                        .appendTo(ul);
            };
    
    
        });
    

    Thanks @Joe. I updated the answer.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Anybody can help me with this code I am getting this error message: Server
I am getting a StackOverflow Error in this code: EDIT [XmlAttribute(ID)] public string ID
Hi i am getting the following error in this code /* Class : CreateMobileChatterCntrl
Am getting this error for my code: Undefined symbols for architecture x86_64: _spendDollars, referenced
I'm getting this error message with the code below: class Money { public: Money(float
I am getting this error here is my code if(isset($_POST['submit'])) { $projTit=mysql_escape_string($_POST['projecttitle']); $projCat=mysql_escape_string($_POST['projectcategory']); $budget=intval(mysql_escape_string($_POST['budget']));
I am getting this error when I run the following code: #!/usr/bin/env ruby -rubygems
I keep getting this error System.Web.HttpException was unhandled by user code Message=Validation of viewstate
I am getting this error when I try to build for the device: Code
I keep getting this error whenever I call gethostbyname() in my C code. ==7983==

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.