How do I set up Google Analytics goals using event tracking?

Hi,

I would like to set up event tracking for an on-page form that does not go to a confirmation page. It uses ajax to submit and the form action calls a .php file from the template.

How do I add the event tracking code to the site? Where does the event "action" get defined?

Regards,

Dave