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 8524171
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T07:36:53+00:00 2026-06-11T07:36:53+00:00

I am trying to write my very first jQuery autocomplete example. I need to

  • 0

I am trying to write my very first jQuery autocomplete example. I need to be able to select multiple values from the autocompletion so I used the example provided here.

No matter what I do I can’t get the textbox to display the values “chicken” and “chickens” when I type “c”, “ch” etc. What am I doing wrong?

My controller has this action method

public JsonResult GetBirds()
{
    var result = new JsonResult
        {
            Data = new
                {
                    Birds = new List<string> {"chicken", "chickens"}
                },
            JsonRequestBehavior = JsonRequestBehavior.AllowGet
        };

    return result;
}

And my front-end code is this:

<script>
    $(function () {
        function log(message) {
            $("<div/>").text(message).prependTo("#log");
            $("#log").scrollTop(0);
        }

        $("#birds").autocomplete({
            source: "/Results/GetBirds",
            minLength: 1,
            select: function (event, ui) {
                log(ui ?
                "Selected: " + ui :
                "Nothing selected, input was " + this.value);
            }
        });
    });
</script>



<div class="demo">

    <div class="ui-widget">
        <label for="birds">Birds: </label>
        <input id="birds" />
    </div>

    <div class="ui-widget" style="margin-top:2em; font-family:Arial">
        Result:
        <div id="log" style="height: 200px; width: 300px; overflow: auto;" class="ui-widget-content"></div>
    </div>

</div><!-- End demo -->
  • 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-11T07:36:55+00:00Added an answer on June 11, 2026 at 7:36 am

    Use Rest Clint or Firebug Firefox plugin to see what is returning from controller.

    Try this:

    return Json(new {“chicken”, “chickens”},JsonRequestBehavior.AllowGet);

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

Sidebar

Related Questions

I am trying to write my very first python script. This was working but
I am trying to write a very simple web-based email client from scratch with
I am just trying to write my very first code in Objective C. I
I'm trying to write my first very own SiteMapProvider subclass. It is meant to
I am trying to write a very basic export to blender (from primitive shapes)
i am trying to select the elements of a list without the very first
I'm trying to write something very similar to an IM client (for learning purposes
I am trying to write a very simple RSS channel which would display the
I'm trying to write a very simple image processing program for fun and practice.
I'm trying to write a very simple program, I want to print out the

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.