json - jQuery UI - Autocomplete with extra params - returned data -


All,

I've gone to use UI Autocomplete instead of plugin, For the time being, I can find additional parameters based on an example, but that part works.

I'm having trouble dealing with return data. In the code given below, I can alert the returning title, but I get the drop down of 'UNDEFINED' in the browser.

Thanks in advance.

  $ ('#DocTitle'). Autocomplete ({source: function (request, response) {$ .ajax ({url: "index.pl", datatype: "Jason", data: {title: request.term, maxRows: 10}, success: function (Data) {response ($ .max (data, function (item) {alert (item title); return {TITLE: item.TITLE}}))}}})}});  

I am using jquery UI autocomplete and it's fair enough for me You can try the same way you are working.

  $ ('input [type = text] [name = city]'). Autocomplete ({source: function (request, response) {$ .getJSON ('(#Input')) () () () () ($ ('input # citysuggestionslink'). Val (), {term: request. Term, stateId: $ ('select # statename option: selected') attr ('value')};}, search: function () {// custom mineral word time = this.value; if (term.length & lt; 1) {return false}}}, delay: 200, focus: function () {// prevention value focus return false;}, select: function (Event, UI) {return false;}}); < / Code> 

Comments