jQuery way:
If your autocompletion source is a plain array (i.e. not an array of label-value pairs or URL), then you can do
$.inArray(ui.item.value,myAutocompleteSource)
e.g.
$('.my-autocompletes').autocomplete({
source:['Option1','Option2','Option3'],
select: function(event, ui) {
alert('Your selected a string with index '+
$.inArray(ui.item.value,$(_self).autocomplete('option','source'))
);
}
});
If the source IS an array of label-value pairs, then you can do
var index = -1;
$(_self).autocomplete('option','source')).each(function(idx) {
if (this.label == ui.item.label) { index=idx; return false; }
});
alert('You selected a string with index '+index);
Of course, $(_self).autocomplete('option','source')) can be replaced with a direct reference to the source of autocomplete items.