Instant search and ajax events
Take a look at Drupal Instant Search, or Finder. Even if it isn't exactly what you want, it should be a good starting point.

Drupal Instant Search:


  It works as follows: The url for the instant is at /instant The user
  types his search word, once he finishes typing (javascript keyup) the
  module automatically submits the search word and returns the search
  results. The search results are displayed at the same page of the
  instant search.
  
  Instant search is also integrated with Top searches module. if Top
  searches module exists, the instant search auto-completes top search
  words.


Finder:

CHECK MODULE FIRST DUE TO THIS WARNING:


  This module is unsupported due to a security issue the maintainer
  didn’t fix.