Hi,

I am currently testing the autocomplete_deluxe's autocomplete_delux_path. The array returned by my callback function looks like:

return(
array(
'some-internal-id-1' => 'Label to display to user 1',
'some-internal-id-2' => 'Label to display to user 2',
'some-internal-id-3' => 'Label to display to user 3',
)
);

When the user sees the returned options, he sees the list of 'Label to display to user X' labels. However, when he clicks one of them, the 'key' is inserted into the autocomplete_delexu's field.

What I would like to be able to do is always to display the 'values' (the labels) and not the key of my array.

Is that possible?

Thanks,

Fred

CommentFileSizeAuthor
#1 label vs. key.png52.81 KBLNakamura
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

LNakamura’s picture

Issue summary: View changes
Status: Active » Postponed (maintainer needs more info)
FileSize
52.81 KB

Hi, @fgiasson - I just tried out your scenario, but I see the value and not the key displayed in the Autocomplete Deluxe field.

I had to modify the return value so that it was JSON, which I assume you did as well:

function leetest_callback($field_name, $tags_typed = '', $limit = 10) {
  return(
    drupal_json_output(array(
      'some-internal-id-1' => 'Label to display to user 1',
      'some-internal-id-2' => 'Label to display to user 2',
      'some-internal-id-3' => 'Label to display to user 3',
    ))
  );
}

See the results in the attached screenshot.

Are you still seeing this problem? Note that I'm running with the latest dev version (there have been a lot of fixes lately)...

Thanks!