I need to display no results found if the search term by the user doesn't matches any result from the database. I have gone through various questions on here, but none helped me.
<script>
$(function() {
function log( message ) {
$( "<div>" ).text( message ).prependTo( "#log" );
$( "#log" ).scrollTop( 0 );
}
$( "#birds" ).autocomplete({
source: "search.php",
minLength: 2,
select: function( event, ui ) {
log( ui.item ? "Selected: " + ui.item.value + " aka " + ui.item.label :
"Nothing selected, input was " + this.actor );
window.location.href = './company.php?id=' + ui.item.indexid + '&name=' + ui.item.label;
}
});
});
</script>
Any suggestion would be helpful.