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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T17:29:12+00:00 2026-06-08T17:29:12+00:00

I have an autocomplete implementation that is based mostly on this tutorial: http://viralpatel.net/blogs/tutorial-create-autocomplete-feature-with-java-jsp-jquery However

  • 0

I have an autocomplete implementation that is based mostly on this tutorial:
http://viralpatel.net/blogs/tutorial-create-autocomplete-feature-with-java-jsp-jquery

However as opposed to the article, I am getting the records from the Database and printing them out in the jsp with out.println(recordValue);
This jsp is called as:

    <input type="text" id="country" name="country"/>
    <script>
        $("#country").autocomplete("getdata.jsp");
    </script>

These records come out of a table containing millions of records so I am only putting top 10 records that I filter with “rowNum < 10;”

This works great for normal data. The problem comes when more than 10 records are returned by the query, and there could be more records…
For instance say I have data like:
Test10, Test11, Test12, Test13, Test14, Test15, Test16, Test17, Test18, Test19, Test20
Let’s say we make a query to fetch the records initially after typing Test, and that returned the 1st 10 records from Test10 to Test19 – which is correct.
But now when the user types Test2 we should query the back-end again, but that is not happening for me…

Like mentioned earlier, returning all the records is simply not an option, because there could be millions of records. But when there is a new character entered (like typing 2 after having typed Test), we need to reach back to the server inside the jsp that is called in the script above, for the getData to be called.

Is there any way to work around this issue?

I have already tried changing to this but it did not work

    <input type="text" id="country" name="country"/>
    <script>
            $("#country").autocomplete({
                    change: "getdata.jsp"
            });
    </script>

Thanks!


Since I can’t add comments without 50 rep, editing the question to respond to @Barmar …

Thanks for your response @Barmar.
I did try by disabling cache in firefox and also in private mode so hopefully it won’t remember anything. But I am still seeing the same behavior

In order to debug further I added an alert in the jquery.autocomplete.js and it seems that that function does get called on key-down, but it still does not propagate the request to the server side on back-end. It seems the javascript is gobbling up the request, or there maybe some logic where it determines whether to send the request to the server. I am looking into this further.

However, what seems weird is a standard product like jquery could have issues, so maybe I am missing some setting/configuration. But I have not been able to figure out yet, what that could be.

Any help 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-06-08T17:29:13+00:00Added an answer on June 8, 2026 at 5:29 pm

    Found the solution to this problem.

    The jQuery autocomplete javascript (the version we have) was caching the values returned by the 1st query, and would not go back to the back-end if any of the values in the cache matched the entered string.

    Just started flushing the cache on keydown, and that resolved the problem.

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

Sidebar

Related Questions

I have autocomplete text box, that is JQuery based. when i record the macro,
I have an autocomplete combobox that creates a new select box based upon the
i have an Autocomplete ajax control that calls a WCF service method automatically. this
I have used autocomplete in jQuery from this link . In the normal browser
I have an autocomplete event that fires correctly once a value is selected. I
I have a autocomplete textbox, in that textbox am getting employee names. If I
I have a jQuery Autocomplete field on an ASP.Net Webform and everything has been
I have a simple autocomplete field that spits out a bunch of suggested words
How do i have an AutoComplete selection based on alphabetic instead of fixed switch
I'm building an web app that uses this code to search for addresses: http://code.google.com/intl/en/apis/maps/documentation/javascript/examples/places-autocomplete.html

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.