Accessibility
Adobe
Sign in Privacy My Adobe

Community Publishing

Created:
2010-02-10
Last Updated:
2010-02-11
by
User Level:
Intermediate/Advanced
Products:
LiveCycle ES

Need more tips and tutorials?


LiveCycle Designer ES2: Create an optional section in an interactive PDF form

You can use Action Builder to build common interactive capabilities in forms, without writing scripts. Using actions, you can control how you present form objects and data and how the objects and data respond to form filler interaction.

Overview

One of the things you can do with actions is hide an optional section of an interactive PDF form until it is relevant to the form fillers needs. For example, you can hide the credit card information section of an invoice until the form filler selects the option to pay with a credit card.

The following example explains how to create a simple section for collecting credit card information, which is displayed after the form filler selects the credit card option.

You create this type of section by laying out the library objects in the Layout Editor, and then building the actions for the objects in the Action Builder dialog box. 

Figure 1 shows the layout and positioning of the objects that make up the Payment Method and Credit Card Information section. Notice that there is no visible text or object borders in the Credit Card Information section when viewed in the Layout Editor, because the Presence setting for the subform is set to Invisible. 

Figure 1: Payment Method and Credit card information sections as shown in the Layout Editor

Figure 2 shows what the Payment Method and Credit Card Information sections looks like in Acrobat or Adobe Reader after the form filler selects the Credit Card payment method option.

Figure 2: The Payment Method and Credit Card Information as displayed in Acrobat or Adobe Reader

Figure 3 shows the type of objects that are used to create the Payment Method and Credit card information sections. Notice the two subforms, Payment and CreditCardInfo, and the structure of the other objects in the hierarchal order.

Figure 3: Objects that make up the Payment Method and Credit Card Information section as shown the Hierarchy palette

Figure 4 shows the three actions built for the three radio buttons in the Payment Method section. Both the Cash.click and Cheque.click actions make the Credit Card Information section invisible. Only the CreditCard.click action makes the Credit Card Information section visible.

 Figure 4: Actions built in the Action Builder dialog box for the Payment Method section

Creating the Payment and Credit Card Information sections

Before you can build the actions to hide or show the Credit Card Information section when a form filler clicks the Cash, Cheque, or Credit Card radio buttons, you must create the Payment and Credit Card Information sections.

To create the Payment Method section: 

  1. In the Object Library palette, click the Standard category and then drag a Subform object the form.
  2. Rename the Subform object. In the Hierarchy palette, right-click the Subform object, click Rename Object, and then type Payment.
  3. Drag three Radio Button objects into the Payment subform. Position them one above the other on the left side of the subform, as shown in Figure 1.
  4. In the Hierarchy palette, rename the three Radio Button objects to Cash, Cheque, and Credit Card.
  5. Drag a Text object into the Payment subform, and position it above the three radio buttons.
  6. Click inside the Text object and type Payment Method.
  7. In the Hierarchy palette, rename the Text object to PaymentMethodHeading.

To create the Credit Card Information section: 

  1. Drag a Subform object into the Payment subform and position it on the right side.
  2. In the Hierarchy palette, rename the Subform object to CreditCardInfo.
  3. Drag a Drop-down List object into the CreditCardInfo subform, and position it next to the Cash radio button, as shown in Figure 1. 
  4. Double click the caption area of the Drop-down List object, and type Card Type.
  5. In the Hierarchy palette, select the Drop-down list object, click the Field tab, and then click the plus sign (+) once for each of the credit cards you want to add.
  6. In the Hierarchy palette, rename the Drop-down List object to CardType.
  7. Drag a Text Field object into CreditCardInfo subform and position it next to Cheque radio button.
  8. Double click the caption area of the Text Field object, and type Card Number.
  9. In the Hierarchy palette, rename the Text Field object to CardNumber.
  10. Drag a Text Field object into the CreditCardInfo subform and position it next to the Credit Card radio button.
  11. Double click the caption area of the Text Field object, and type Expiration Date.
  12. In the Hierarchy palette, rename the Text Field object to ExpirationDate.
  13. Drag a Text object into the CreditCardInfo subform and position it above the other objects, as shown in Figure 1.
  14. Click inside the Text object and type Credit Card Information.
  15. In the Hierarchy palette, select the CreditCardInfo subform, click the Subform tab, and then in the Presence list, select Invisible. 

Building the actions for the Payment Method section

After you have created the Payment Method and Credit Card Information sections, you must build an action for each of the three radio buttons, Cash, Cheque, and CreditCard.

To build the action for the Cash radio button object:

  1. Select Tools > Action Builder.
  2. Click the Add A New Action button.
  3. In the Condition area, click the Add A Condition button.
  4. Click the object link.
  5. In the Select An Object dialog box, select the Cash radio button
  6. In the Result area, click the Add a Result button.
  7. In the Result list, select Show or Hide an object.
  8. Click the Object link, and in the Select An Object dialog box, select the CreditCardInfo subform, and then click OK.
  9. In the Visibility list, select Invisible.

To build the action for the Cheque radio button object:

  1. Click the Add A New Action button.
  2. In the Condition area, click the Add A Condition button.
  3. Click the object link.
  4. In the Select An Object dialog box, select the Cheque radio button
  5. In the Result area, click the Add a Result button.
  6. In the Result list, select Show or Hide an object.
  7. Click the Object link, and in the Select An Object dialog box, select the CreditCardInfo subform, and then click OK.
  8. In the Visibility list, select Invisible.

To build the action for the Credit Card radio button object:

  1. Click the Add A New Action button.
  2. In the Condition area, click the Add A Condition button.
  3. Click the object link.
  4. In the Select An Object dialog box, select the CreditCard radio button
  5. In the Result area, click the Add a Result button.
  6. In the Result list, select Show or Hide an object.
  7. Click the Object link, and in the Select An Object dialog box, select the CreditCardInfo subform, and then click OK.
  8. In the Visibility list, select Visible.
  9. Click OK.

 

 

Creative Commons License
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License