is "return $.map(data, function(row) " passing the json variable to
data or row?

it looks to me like row is an empty variable.

On Sep 29, 1:13 pm, Asa Carter <asa_car...@hotmail.com> wrote:
> Hi
>
> My php is returning via json:
>
> a string (name) which is displayed in the text box
> an int (location_id)
>
> When the form is posted I would also like to post 'location_id' as
> well as / instead of 'name'.
>
> My js is below. what do I need to do to be able to post the
> location_id.
>
>         $("#quick-search").autocomplete('/includes/search.php', {
>                 width: 300,
>                 scroll: false,
>                 dataType: "json",
>                 parse: function(data) {
>                         return $.map(data, function(row) {
>                                 return {
>                                         data: row,
>                                         value: row.location_id,
>                                         result: row.name
>                                 }
>                         });
>                 },
>                 formatItem: function(mail) {
>                         return mail.name;
>                 }
>         });
>
> Thanks
>
> Asa

Reply via email to