Livecycle script object se To add script to a script object
For example, create a script object called feedback that contains the following function:
if ((oField.rawValue == null) || (oField.rawValue == “”)) {
xfa.host.messageBox(“You must input a value for this field.”, “Error Message”, 3);
}
}
See also 

To add script to a script object