By localhost on
my project site has users with their full names (first last) as their usernames. I've been using autocomplete for the search function but it only retrieves entries that are written in the same manner, ie. first last. it won't work if i start typing the last name first. does anybody know how i can edit the default user_autocomplete so that it will work whether i type in the first or the last name when matching entries against the user database...
Comments
Quick change
You'll have to modify (yuck, sorry) the user.module. Search for the following line in the
user_autocompletefunction:and replace it with:
No go
The extra %% didn't work. code stopped working. Any more ideas?
oops
it works!
maybe a better approach..
Rather than modifying the user.module, it's better to creat a custom module. and copy the autocomplete code. Then you can modify the search string as per requirement and just point the #autocomplete_path in your form to your new module.
Check it out: http://drupal.org/node/147029
Arjun