I found a solution that works:
select: function(event, ui) {
$('.ui-autocomplete a').attr('href', '/id/'+ ui.item.id +'/'+ ui.item.label +'/');
}
Explaination:
The jquery-ui-autocomplete function creates a list of links ()-tags, normally you would use preventDefault()
to stop the browser from going through to the href address, since in my case that is not possible I tried using return false
instead but since that doesn't work either in this case I finally figured, why not change the link-tags href to the correct url instead and not halt the action, which works!