Autocomplete - highlight first item in dropdown

Autocomplete - highlight first item in dropdown

I need to hightlight/select the first item in the autocomplete dropdown choices.  Any suggestions?

Here is the code I am using:
  1.  $( "##tests" ).autocomplete({
                        source: function( request, response ) {
                            $.getJSON( "../cfcs/tests.cfc?method=searchTestsAjax&returnformat=json", {
                                term: extractLast( request.term )
                            }, response );
                        },
                        search: function() {
                            // custom minLength
                            var term = extractLast( this.value );
                            if ( term.length < 1 ) {
                                return false;
                            };

                        },
                        focus: function() {
                            // prevent value inserted on focus
                            return false;
                        },
                        select: function( event, ui ) {
                            var terms = split( this.value );
                            // remove the current input
                            terms.pop();
                            // add the selected item
                            terms.push( ui.item.value );
                            // add placeholder to get the comma-and-space at the end
                            terms.push( "" );
                            this.value = terms.join( ", " );
            
                            return false;
                        }































    • Topic Participants

    • karl