Regardless of the type of form you create, you can take advantage of the XML Form Object Model messageBox method to display messages or field values at run time. When initiated, the messageBox method displays a string value in a new client application dialog box. The string value can be a text message that you create for debugging purposes or the string value of fields or expressions.
For example, consider a scenario with a simple form design that contains a single numeric field (NumericField1) and a button (Button1). In this case, the following FormCalc calculation and JavaScript script each output a message displaying some text and the value currently displayed in the numeric field. By adding either the calculation or the script to the click event of the button object, you can interactively display the value of the numeric field in a new dialog box by clicking the button.
xfa.host.messageBox(Concat(“The value of NumericField1 is: “,
NumericField1), “Debugging”, 3)
xfa.host.messageBox(“The value of NumericField1 is: ” +
NumericField1.rawValue, “Debugging”, 3);
Caution:
The messageBox method returns an integer value representing the button that the form filler selects in the message box dialog. If you attach the messageBox method to the calculate event of a field object, and the messagebox method is the last line of the script, the field displays the return value of the messageBox method at run time.
In some situations, such as if you want to return a message box during a calculate event, you can take advantage of the alert method from the JavaScript Object Model from Acrobat. For example, the following script returns the value of a text field:
var oField = xfa.resolveNode(“TextField1″).rawValue;
app.alert(oField);
For more information about the alert method and the JavaScript Object Model from Acrobat, see Developing Acrobat Applications Using JavaScript at http://www.adobe.com/go/learn_lc_AcrobatDeveloper (English only).
See also 

Providing debugging feedback using the messageBox method