In this recipe, we will see how we can create a simple interactive form with form elements and some script written in FormCalc language. We will create an example where we create three fields on the screen and a button that will calculate the total of the value of the first two fields and display within the third field.
From the Adobe LiveCycle Designer, choose the menu option Edit and then select Form Properties. On the Defaults tab, within the Preview block, select Interactive Form within the Preview Type drop-down list and Acrobat 8 (Dynamic) XML Form for the XDP Preview Format drop-down list.
Follow these steps:
Total
.We can see the PDF Preview window by clicking on the Preview PDF tab in the layout editor. We can only enter a maximum of two decimal places. Any amount entered in the first two fields is shown in the format specified. For example, if we enter 1200.78
, it will be changed to $1,200.78. When the Total button is pressed, the two values are totaled and shown in the Total field. Upon clicking the Total button, the script for the button-click event of the button is executed. The totaling is done and then displayed.
We may also test the form through the Test button of transaction SFP
. In this case, the SFP
transaction will take us to the function module test screen. For testing the interactive scenario, the FILLABLE field for the /1BCDWB/DOCPARAMS structure must be passed the value 'X'
. This will open the PDF form in the interactive mode, as shown in the following screenshot:
3.133.138.14