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.
|
var oField = xfa.resolveNode(“TextField1″).rawValue;