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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:50:33+00:00 2026-05-27T11:50:33+00:00

I’m using the jqueryUI autocomplete widget on my site. Say i have the following

  • 0

I’m using the jqueryUI autocomplete widget on my site. Say i have the following items in my database…

  • apple
  • ape
  • abraham
  • aardvark

When I type “a” in the autocomplete widget i get that list below my input field. I’ve written additional code such that when you select an item it is added to a UL below the input field and the input field is cleared.

So, you type “a”, you see that list, and you select apple. Apple is now an LI in the UL below the input field. You now type “a” again, and you see the list again… Here’s my problem.

This second time I want to show everything EXCEPT apple.

I’d love to know how to do this in two different places:

1 – i’d love to know how to intercept the event that fires a GET query to the server, so that instead of sending “q=a” to the server when you type “a”, i could make it send “q=a&exclude=apple,foo,bar”. Then I filter the list server side and everything’s good.

2 – I’d also love to know how to intercept the event that builds the list of options. That way, I could see that it’s about to display the options “apple, ape, etc” and I could snip “apple” out of that list.

I see the events in the docs – but I’m not sure how to use them to accomplish the goals stated above.

Thanks!

  • 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-27T11:50:34+00:00Added an answer on May 27, 2026 at 11:50 am

    You can accomplish both of these by defining a function for the source option of the autocomplete widget. From there, you’d perform the AJAX request yourself with $.ajax. Something like:

    $("input").autocomplete({
        source: function (request, response) {
            var exclude = /* build excluded items list. */;
            var term = request.term;
    
            $.ajax({
                url: "server.php",
                data: { q: term, exclude: exclude },
                dataType: "json",
                success: function(data) {
                    /* Here, you could accomplish #2 by filtering items out of data */
                    /* You must call the supplied callback to let the widget know what to suggest */
                    response(data);
                }
            });
    
        }
    });
    

    I would imagine you would build the excluded items just by extracting the items already in the ul.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I have a French site that I want to parse, but am running into
I have thousands of HTML files to process using Groovy/Java and I need to
I have a reasonable size flat file database of text documents mostly saved in
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have a jquery bug and I've been looking for hours now, I can't

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.