Ajax update input fields using data from database

Does anyone have any information or links to tutorials on how to have
a select list update other fields in a form using ajax?

Example. I have list of customers stored in a database. I would like
to have a drop down containing a list of customers on a form, that
when selected, would update several input fields on a form with the
customer details from the database.

Any ideas?


Use the Rails observe_field function (http://api.rubyonrails.org/

Here is an example of it in use (http://www.railshosting.org/
#live_searching), obviously they are using it for a different purpose
but the underlying logic is the same:-

1. Observe field changing
2. Make AJAX request
3. Update page element