Find out what users DIDN'T submit in input field.
You could add a keystroke event listener and simply listen to the backspace keypress event.
When that happens, save and ajax the form field value to your server for storage.
EDIT: On basis of Scott Selby's anser:
To cover all bases:
Event listener for keypress backspace
Event listener for selection start and end. Save and ajax the selected part if if the form field has changed on the next keypress.
Catch onunload event, safe form data if exists.
That way you always get what the users deleted. This also helps making your search query window "typo" proof because you'll be able to spot "common" mistakes over time.
It's also a good way to collect data on what products or services your potential clients expect from you.
I'm using Jquery autocomplete on an input field. So, as users type out a word, they can see a drop-down list showing fewer and fewer choices to select from. 
The thing is, sometimes the user's input will not be among the choices in that list. I believe that when users see that list go empty, they will give up on their original search term and either enter a different one, or simply delete it and leave the field blank. 
When that happens, I want to know what was the original search term entered? 
(Because after collecting that info over time, I plan to add the most popular ones to the list, for future users to choose from)
So my question is, what is the best way to find out what users typed in, but didn't submit? 
My idea so far is to listen for when the user takes the focus off the input field, and get it's value on change. That will tell me about users who deleted and left it blank, but it still doesnt tell me anything for the users who deleted and then entered a new term.
Is there a better solution? 
PS - My site is on GAE, so if using python opens any relevant doors... there's that too.