One way to do this is to use a regex to validate the input. You can put the following code into the exit event of the field. Make sure the language is set to JavaScript:
var pattern = /^[\sa-zA-Z\-]*?$/;
if(!this.rawValue.match(pattern)) {
xfa.host.messageBox("Only letters may be entered into this field.");
this.rawValue = '';
}
The regex ensures that only alpha characters are entered into the field and also allows a hyphen and a space to accommodate some names (for example van der Camp or Parker-bowls). If the regex is not matched, the popup appears. Then lastly the invalid data is cleared.