$(function () {
function log(message, id) {
id = "#" + id.replace("Name", "Id");
$(id).val(message)
}
$("[id^='RegionName']").autocomplete({
source: "/regions-for-admin",
minLength: 3,
select: function (event, ui) {
log(ui.item.value, this.id)
}
})
});