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,446
  • 76
  • 161
  • 247
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,493
  • 4
  • 33
  • 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
  • 25,490
  • 6
  • 66
  • 63
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
  • 32,614
  • 12
  • 69
  • 100