Link to home
Start Free TrialLog in
Avatar of Victor Kimura
Victor KimuraFlag for Canada

asked on

jQuery UI autocompete

Hi,

1) I'm wondering how I can use the jQuery UI autocomplete. In the list I'll have First name and last name as the values and text. Here is a sample name list:
Jack Henry
Jill Moore
Randy Tuttle
Henry Miller
Enrique Sands

If I type in "en" then I get Jack Henry, Henry Miller and Enrique Sands but I'm wondering if it's possible to just search by the beginning characters. So if I type in "en" then the autocomplete will search for any first name that starts with "En".

2) Is there any good example so the list can be built from a table? I guess it would load on #(document).ready()
ASKER CERTIFIED SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Victor Kimura

ASKER

Hi leakim971,

Just a couple of questions from that stackoverflow page:
source: function( request, response ) {
                var t = jQuery.grep(t, function(a){
                        var patt = new RegExp("^" + request.term, "i");
                        return (patt.match(a));
                    });
                response(t);
            },

Open in new window


1) What is the "t" variable of the grep parameter?
2) What is the "a" variable of the function parameter?
3) Where the source go or where is it from?

Sorry, still learning the jQuery UI.

Thanks,
Victor