I'm using the jquery UI autocomplete plugin. The value that is being returned contains several pieces of data, including some that is encoded. When the user uses the keyboard to scroll through the labels returned by the ajax call, the encoded values display in the field. I've got code to replace the value with the label after it's been processed on select so, after they select, the label is displayed. Is there a way to not show the value as the user is scrolling through the results?
Here is my code:
$('#text_field').autocomplete({
minLength: 3,
source: "some_page.php?gender=f623e75af30e62bbd73d6df5b50bb7b5",
select: function(event, ui){
var valArray = ui.item.value;
ui.item.value = '';
valArray = valArray.split('~');
$('#search_button').attr('href', 'somepage.com/report.php?attr_one='+valArray[0]+'&attr_two='+valArray[3]);
ui.item.value = ui.item.label;
}