Why the autocomplete widget doesn't work if the text is NOT empty?
<p>How is ti possible that the code below show the array ONLY if the text is empty... It should show the list during the typing NOT when the text is empty.</p>

<p>STEPS:</p>

<ol>
<li>Focus on text</li>
<li>type a text, like 'abc' (this text returns an array doing the ajax call)</li>
<li>nothing happen</li>
<li><p>delete 'abc' and i see the array correctly.</p>

<pre><code>$('#titolare').keyup(function(){
  var titolare = $.trim($('#titolare').val());

  $.ajax({
    type: "POST",
    url: "page.php",
    data: { titolare: titolare },
    success: function(msg){          
      var obj = jQuery.parseJSON(msg);

      if (obj.result){
        var tit   = obj.titolare
          , tit_a = [];            

        $.each (tit, function (a) {              
          tit_a[a] = { titolare: tit[a].titolare, cod_fis: tit[a].cod_fis };
        });         

            $("#titolare").autocomplete({
          minLength: 0,         
          source: tit_a,
                focus: function( event, ui ) {             
                    $("#titolare").val(ui.item.titolare);
                    return false;
                },
                select: function( event, ui ) {            
                    $("#titolare").val(ui.item.titolare);
                    return false;
                }
            })
            .data( "autocomplete" )._renderItem = function(ul, item) {          
                return $( "&lt;li&gt;&lt;/li&gt;" )
                    .data( "item.autocomplete", item )
                    .append( "&lt;a&gt;" + item.titolare + "&lt;br /&gt;("+ item.cod_fis +")&lt;/a&gt;")
                    .appendTo( ul );
            };            

      }                                             
    }
  });        
});
</code></pre></li>
</ol>
