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:
  3. In the Script Source field, 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 Check Script to ensure that there are no syntax errors.
  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.


 

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

Current page: http://livedocs.adobe.com/livecycle/es/wb_help/00000442.html