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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T00:04:46+00:00 2026-05-17T00:04:46+00:00

I have implemented an autocomplete in my app for zip codes. I am debugging

  • 0

I have implemented an autocomplete in my app for zip codes. I am debugging in Firebug and I see in my console that the action is performing and I get a list of zip codes in the list of results, but the actual list is not displaying when I debug.

Here’s the action in my Customers controller:

//the autocomplete request sends a parameter 'term' that contains the filter
public ActionResult FindZipCode(string term)
{
    string[] zipCodes = customerRepository.FindFilteredZipCodes(term);

    //return raw text, one result on each line
    return Content(string.Join("\n", zipCodes));
}

Here’s the markup (abbreviated)

<% using (Html.BeginForm("Create", "Customers")) {%>
<input type="text" value="" name="ZipCodeID" id="ZipCodeID" />
<% } %>

and here’s the order I load my scripts:

<script type="text/javascript" src="/Scripts/jquery-1.4.2.js"></script>
<script type="text/javascript" src="/Scripts/jquery.ui.core.js"></script>
<script type="text/javascript" src="/Scripts/jquery.ui.widget.js"></script>
<script type="text/javascript" src="/Scripts/jquery.ui.position.js"></script>
<script type="text/javascript" src="/Scripts/jquery.ui.autocomplete.js"></script>
<script type="text/javascript">
    $(document).ready(function() {
        $("#ZipCodeID").autocomplete({ source: '<%= Url.Action("FindZipCode", "Customers") %>'});
    });
</script>

Anything obvious that I’m missing? Like I say the script is grabbing the list of zip codes, they just won’t display on my page when I test.

EDIT: I added an image that shows what I see in firebug – it appears that I get my zip codes back, but just won’t display the dropdown.

I also updated my text box so that it’s inside of the ui-widget div like so:

<div class="ui-widget">
    <input type="text" name="ZipCodeID" id="ZipCodeID" />
</div>

and this is the script that I’m using:

<script type="text/javascript">
    $(document).ready(function() {
        $("#ZipCodeID").autocomplete('<%= Url.Action("FindZipCode", "Customers") %>');
    });
</script>
  • 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-17T00:04:46+00:00Added an answer on May 17, 2026 at 12:04 am

    I was able to get the autocomplete suggestions working using the following code:

    Controller:

    public JsonResult FindZipCode(string term)
        {
            VetClinicDataContext db = new VetClinicDataContext();
    
            var zipCodes = from c in db.ZipCodes
                           where c.ZipCodeNum.ToString().StartsWith(term)
                           select new { value = c.ZipCodeID, label = c.ZipCodeNum};
    
            return this.Json(zipCodes, JsonRequestBehavior.AllowGet);
        }
    

    Markup:

    <script type="text/javascript">
        $(document).ready(function() {
            $("#ZipCodeID").autocomplete({
                      source: '<%= Url.Action("FindZipCode", "Customers") %>',
            });
        });
    </script>
    
    <div class="ui-widget"><input type="text" name="ZipCodeID" id="ZipCodeID" /></div>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have implemented Facebook into my app but now I find that whenever I
I know that it works. I have implemented it successfully. $(#vehicle_application_product_id).autocomplete({ minLength: 2, source:
I have implemented an autocomplete / instant search on a mobile application that I
I have implemented the jquery ui autocomplete as in the example: autocomplete with custom
I have implemented one matrix multiplication with boost::numeric::ublas::matrix (see my full, working boost code
I have implemented a UISearchDisplayController that allows users to search a table. Currently the
I have just implemented the excellent jQuery UI autocomplete. http://jqueryui.com/demos/autocomplete/ There is a strange
I have implemented a jquery ui autocomplete with data from database. Right now what
I have successfully implemented Autocomplete field from database using sfWidgetFormJQueryAutocompleter but i cannot a
I have a search field that I want to autocomplete with data that I

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.