sparrowk
sparrowk

Reputation: 11

Converting Acrobat JavaScript to Adobe ES4 Deigner JavaScript

I have a few JavaScripts that worked well in Acrobat. I haven't been able to get them to work in Adobe ES4 LiveCycle Designer (I'm a novice).

One of the JS is to enable a tick in a checkbox when text is entered into a text field.

In LifeCycle ES4, I have entered the JavaScript in Script editor, and have 'Show: Validate*'. Unfortunately JavaScript seems not to be working. Any help greatly appreciated. Acrobat JavaScript I'm trying to convert to ES4 is:

 this.getField("checkbox 1").checkThisBox(0, (event.value!=""));

Kind regards

Kevin

Upvotes: 1

Views: 78

Answers (2)

Mike H.
Mike H.

Reputation: 1

Use the capabilities of LiveCycle.
Create the checkbox. Create the text field. Right-click on the text field. Select Add Action. Set the condition of when the text field is not empty, the value of the check box to be checked. Optionally you may want to also set the check box to read only.

I'm doing this for a form I'm creating where a comment is required before the item can be checked off.

Upvotes: 0

Max Wyss
Max Wyss

Reputation: 3615

In short, there is no way to automatically/programmatically convert Acrobat JavaScript to XFA JScript. The object models, as well as the event handling models are too far apart.

The most reliable way to do such a conversion is to know what the Acrobat JavaScript is doing, and then find a way to do the same in XFA JScript.

In other words, recreate the script.

Upvotes: 1

Related Questions