Jquery auto complete - display only 4 clearly visible options

Hi there,

I’m looking to get this autocomplete script working, so far it’s been a pleasure. What i have figured out is that i don’t want to display all my choices, that will be an overwhelming experience…

So my idea is to only display 5, clearly visible but underneath the last one, have a bit of text that informs the user there are also 6 similar courses. So im guessing its a minipulation of the suggestions, but i am having difficulty…

Here is the code so far…

$( "#project" ).autocomplete({
               minLength: 0,
               source: projects,
               focus: function( event, ui ) {
                  $( "#project" ).val( ui.item.label );
                     return false;
               select: function( event, ui ) {
                  $( "#project" ).val( ui.item.label );
                  $( "#project-id" ).val( ui.item.value );
                  $( "#project-description" ).html( ui.item.desc );
                  return false;
            .data( "ui-autocomplete" )._renderItem = function( ul, item ) {
               return $( "<li>" )
               .append( item.desc )
               .appendTo( ul );

Any pointers would be great, thank you…

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.