In LiveCycle Designer ES, you can script against certain JavaScript objects in Acrobat by using the Acrobat scripting syntax. As a result, you can use the properties and methods of those objects on your form. For example, to display a message in the JavaScript Console from Acrobat, you can add the following script to the event of a form design object in LiveCycle Designer ES:You can also have the form send itself by email by adding the following script to the click event of a button:
Note: In LiveCycle Designer ES, you must ensure that the scripting language for the event is set to JavaScript so that the script will execute correctly at run time.You can also use references to the JavaScript objects in Acrobat in your reference syntax. For example, the following script gets the signed state of a signature field and takes an action based on the state:var oState =
event.target.getField(“form1[0].#subform[0].SignatureField1[0]“)
.signatureValidate(); //Get the field’s signed state.
Note: This example uses a fully qualified reference syntax to reference the text For more information about referencing form design objects, see “Referencing object properties and values”.When working with JavaScript from Acrobat in LiveCycle Designer ES, remember these points:
• In LiveCycle Designer ES, use event.target to access the Doc JavaScript object from Acrobat. In Acrobat, the this object is used to reference the Doc object; however, in LiveCycle Designer ES, the this object refers to the form design object to which the script is attached.
• The Script Editor has no statement completion for JavaScript objects from Acrobat. See the JavaScript for Acrobat API Reference at http://adobe.com/go/learn_lc_AcrobatDeveloper.For more information about converting Acrobat scripting to LiveCycle Designer ES, see the article Converting Acrobat JavaScript for Use in LiveCycle Designer ES Forms in the LiveCycle ES Developer Center at http://www.adobe.com/go/learn_lc_AcrobatDeveloper.