autocomplete data selected validation jquery
$(function () {
$("#auto").autocomplete({
source: ['Afghanistan', 'Australia', 'Denmark', 'Sweden', 'France', 'Greece', 'Iraq'],
change: function (event, ui) {
if (!ui.item) {
this.value = '';
}
}
});
});