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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T04:16:27+00:00 2026-06-04T04:16:27+00:00

I’ve got a requirement which I have to implement autocomplete, but I’m not sure

  • 0

I’ve got a requirement which I have to implement autocomplete, but I’m not sure if I could achieve this in jQuery UI Autocomplete. If I cannot do this in jQuery UI autocomplete could you please suggest the library that can do this or should I build my own library.

The requirement would be I have a list which is just plain javascript ordered array, when user types something the textbox suggests the possible results. When the user clicks the result, the list should change to show the 3 results above the clicked result and the 3 results below the clicked results.

Here’s the code that I’m trying to do.


    $(function() {
        var projects = [
            "List1","List2","List3","List4","List5","List6","List7","List8"
        ];

        $( "#project" ).autocomplete({
            minLength: 0,
            source: projects,
            focus: function( event, ui ) {
                $( "#project" ).val( ui.item.label );
                return false;
            },
            select: function( event, ui ) {
                $( "#project" ).val( ui.item.label );
                return false;
            }
        })
        .data( "autocomplete" )._renderItem = function( ul, item ) {
            return $( "
  • " ) .data( "item.autocomplete", item ) .append( "" + item.label + "" ) .appendTo( ul ); }; });

    For example, if user types “Li” it should pop up “List1”, “List2″ ,”List3”, “List4”, “List5”. Once the user clicks “List3”, the result list should be changed to be “List1″,”List2″,”List3″,”List4″,”List5″,”List6” and ignore “List7”, “List8”

    Is this even possible in jQuery UI Autocomplete?

    • 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-04T04:16:28+00:00Added an answer on June 4, 2026 at 4:16 am

      Yeah it sounds like you need to simply interrogate which option is being referenced then use the .next() or .prev() jquery function. These are relative iteration tools (one forward, one backward) and with a little finesse should do what you want. This is plain-jane jquery so you would need to build this into your listener (keystrokes in this case)

      next: http://api.jquery.com/next/

      prev : http://api.jquery.com/prev/

      • 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 have a jquery bug and I've been looking for hours now, I can't
    this is what i have right now Drawing an RSS feed into the php,
    I have this code to decode numeric html entities to the UTF8 equivalent character.
    I have a French site that I want to parse, but am running into
    I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
    I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
    I have a text area in my form which accepts all possible characters from
    Seemingly simple, but I cannot find anything relevant on the web. What is the
    I have some data like this: 1 2 3 4 5 9 2 6

    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.