how to inititate AJAX get when user clicks off of a textbox / fills a textbox

how to inititate AJAX get when user clicks off of a textbox / fills a textbox

Hi there,

I've been reading about jquery and ajax and I'm not exactly 100% sure as to how to implement it.

Essentially I have the following:

a textbox
a select box
another select box

As the user fills data in the textbox and then clicks off I want the javascript to fire, submit the value in the textbox to a url (I can handle the backend side of it all fine) which will then send new data to the select boxes. Similarly for the second select box when a user clicks off (After selecting) I need the jquery to fire again. 

I've seen this code and think I get how to write it in, but I'm not sure how to do the (When user clicks off bit of it)
  1. $.get('ajax/test.html', function(data) {
  2.   $('.result').html(data);
  3.   alert('Load was performed.');
  4. });

Any clues would be greatly appreciated.
A