Adding calculations to your form design

You will make a form more interactive by adding a calculation to your form design. You add JavaScript™ by using the Script Editor to calculate the mortgage amount in your form design.

Note:   You may need to drag the bottom of the Forms toolbar to expand the area for the Script Editor.

To add a calculation to the mortgage amount:

  1. In the Hierarchy palette, select Mortgage.
  2. In the Script Editor, select the appropriate options:

    The Script Editor should look like this illustration:

    Script Editor with the first line of script

  3. In the Script Editor, below the first line, type the following calculation:

       if (PropertyPrice.rawValue > DownPayment.rawValue)

          {

             this.rawValue = PropertyPrice.rawValue - DownPayment.rawValue;

          }

       else

          {

             this.rawValue = 0;

          }

  4. In the Script Editor, click the Check Script icon  to ensure that no syntax errors exist.
  5. Save your form design.

You have added a calculation to the Mortgage field.

You have finished the form design. The following illustration shows how your form looks in Design View.

Finished form design

Click to continue: Testing form designs


Adobe LiveCycle ES Update 1

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/livecycle/8.2/wb_help/000057.html