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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T21:02:39+00:00 2026-06-11T21:02:39+00:00

I found more than a couple examples of this with a plain jquery autocomplete

  • 0

I found more than a couple examples of this with a plain jquery autocomplete but not in a way that will work with the autocomplete included in the combobox code from the demo because the structure of the code is structured so differently.

I want to match every item that has all of the search tokens anywhere in any word. I don’t need to match the start of any word, any part of it is fine. I don’t care if the search strings are highlighted in the autocomplete list if that makes things too complicated.

Desired search/result combos: (please excuse the spacing)
“fi th” “fi rst second th ird”
“rs on” “fi rs t sec on d third”
“ec rd” “first s ec ond thi rd“
but not limited to any max/min length or number of tokens.

EDIT

I figured part of it out using the code structure from the other autocorrect I had working.

source: function( requestObj, responseFunc ) {
    var matchArry = $("select > option").map(function(){return this.innerHTML;}).get();
    var srchTerms   = $.trim(requestObj.term).split(/\s+/);

    // For each search term, remove non-matches
    $.each (srchTerms, function (J, term) {
        var regX = new RegExp (term, "i");
        matchArry = $.map (matchArry, function (item) {
            if( regX.test(item) ){
                return{
                    label: item,
                    value: item,
                    option: HTMLOptionElement
                } ? item :null;
            }
        } );
    });

    // Return the match results
    responseFunc (matchArry);
},

and

select: function( event, ui ) {
    ui.item.option.selected = true;
    self._trigger( "selected", event, {
        item: ui.item.option
    });
    $("destination").val(ui.item.value);    // I added this line
},

but I can’t get both multiple words AND being able to click to select working at the same time.

If I remove the } ? item :null; on the return in the map function I can click to select an item. If I leave it I can type multiple words, but I can’t click any of the items…

Is that the problem or the option: this? I’ve tried replacing it with HTMLOptionElement and null and I’m stuck.

I am able to set the value of another field with ui.item.value within the select label but that doesn’t put the value in the search box or close the dropdown menu.

  • 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-11T21:02:40+00:00Added an answer on June 11, 2026 at 9:02 pm

    On a whim I added ui.item.option = ui.item.value; to the select label and everything works as expected. the option: value in source doesn’t seem to matter now.

    *I make no claims that any of this is good coding practice

    updated fiddle: http://jsfiddle.net/eY3hM/

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

Sidebar

Related Questions

Found more than 10 tutorials to cursors but I can't understand that. My question
I found this question but it was only similar and, more importantly, dated by
I have a question with this project https://github.com/sephiroth74/AndroidWheel .. I have found more questions
i found http://visualjquery.com/ more useful when i was learning jQuery with each function explained
This is more for information then a problem. (On searching Stack Overflow I found
I've found a similar question here , but I'm looking for more general solutions.
When moving to Spring 2.5.x I found that it adds more stereotype annotations (on
I have recently found myself becoming more negative about EF and cannot help wondering
I found some problem. When i running apc_store and more times update a page
In doing a bit more programming with Firebase today, I found myself wishing for

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.