The following Visualforce code demonstrates how to call an Apex ActionMethod after a user exits the field. Here customer is an instance of the Account SObject which has the custom field Date_Of_Birth__c. I want to check the age of the customer to see if he is at least 18. This code uses the actionSupport tag to listen for the onblur event (when the user leaves the field), then calls checkDateOfBirth() method in the controller (or extension).
This Apex code from the controller inspects the date of birth field and adds an error if the date entered is not from 18 years prior to the current date.
When the user enters an age less than 18 they are shown the error message on the field widget.