1
$("#suggest3").autocomplete(someArray, {
    multiple: true,
    mustMatch: true,
    autoFill: true

});

"Jhon Smith" 
"Borris Baker" 
"Dove Elliot" 

Now in the above combination when i would type 'Jhon Smith' a value ( Jhon Smith ) will be available in the dropdown....But how to tweak so that even when i type 'Smith Jhon' still the value ( Jhon Smith ) is available for selection... :s

i.e. Like in Gmail no matter what is the sequence of the words included in the name of a person it shows that result as long as the 'Jhon' and 'Smith' is there... i.e. sequence doesn't matter.

dev.e.loper
  • 35,011
  • 72
  • 156
  • 240
Raul Ruman
  • 11
  • 1
  • 2
  • See answer to my question here: [http://stackoverflow.com/questions/2382497/jquery-autocomplete-plug-in-search-configuration/2405646#2405646](http://stackoverflow.com/questions/2382497/jquery-autocomplete-plug-in-search-configuration/2405646#2405646) – dev.e.loper Mar 09 '10 at 14:45

3 Answers3

3

Here is an example of Gmail style matching: http://jsbin.com/utojoh/2

type 'bl' for example

Nader
  • 5,333
  • 4
  • 30
  • 31
0

The Jquery Autocomplete plug-in you are using probably can't be tweaked easily to your requirements. However you can get some hints from this script:
Source for "Google Contacts Autocomplete" – Userscripts.org

o.k.w
  • 24,849
  • 6
  • 63
  • 62
0

In my case, I pulled the result set from a database after I split the words and used a LIKE clause in the SQL.

EDIT: Just and FYI, I did a sort so that if they entered "Jhon Smith" it would put results in priority order:

Jhon Smith
Jhon Smithy
Jhon Friday
Carl Smith
Mark Schultheiss
  • 30,473
  • 11
  • 66
  • 95