UI, Autocomplete JSON data returned

UI, Autocomplete JSON data returned

All,

I've moved on to using the ui autocomplete rather than the plugin, took me a while to figure out extra params based on an example I found here, but that part works.

I'm having problems with dealing with the return data. In the code below I can alert out the title being returned, but I get a drop down of 'UNDEFINED' in the browser.

Thanks in advance.

  1.     $('#DocTitle').autocomplete({
  2.         source: function(request, response) {
  3.            $.ajax({
  4.                 url: "index.pl",
  5.                 dataType: "json",
  6.                 data: {
  7.                     Title: request.term,                       
  8.                     maxRows: 10
  9.                 },
  10.                 success: function(data) {
  11.                     response($.map(data, function(item) {
  12.                     alert(item.TITLE);
  13.                     return {
  14.                         TITLE: item.TITLE            
  15.                     }
  16.                 }))
  17.                 }
  18.             })
  19.         }
  20.     });