On Autocomplete empty I have a project that I need to display some help text to the user if an autocomplete text comes back empty. 

Right now, the autocomplete is on a custom form, and I'm using an autocomplete like:

function autocomplete($string) {
  $result = autocomplete_lookup($string);
  $matches = array();
  // Save the query.
  foreach ($result as $row) {
    // Perfom my logic rows here.
  }

  drupal_json_output($matches);
}


Is there a way I can run a check at some point in the process to display a pop up or something if the autocomplete doesn't return anything?
Not sure if it would help or not, but if your looking for trying to tell the user nothing exists in the database, you can always add logic to the autocomplete that will return something to the field that indicates no results are found.