Copy link to clipboard
Copied
Hi there,
I want to do one of the most basic operation in a form.
I have 2 fields only, with names that contain only letters.
I would like FieldA to be equal to FieldB * 5.
I thus go to the Calculate tab for FieldA, select Simplified Field Notation, click Edit, type "FieldB * 5." (without the quotes), click OK ...
and the Calculate tab still indicates "Value is not calculated"
If I use the "Value is the sum of the following fields" instead, just to see if the whole thing works, and select FieldB only, then after clicking on OK, the "Value is the sum of the following fields" is checked, but nothing appears in the box below it. If I close the edit, and enter a value in FieldB, nothing changes in FieldA.
These seem to be the most basic operations possible, and they are obviously not working.
Can anybody tell me what I am missing?
Many thanks!
Nicolas
In Acrobat you can use an external JavaScript editor. In the preferences of Acrobat you can specify this.
Copy link to clipboard
Copied
As a test, what happens if you use the following custom calculation JavaScript:
event.value = 5 * getField("FieldB").value;
Be sure to check the JavaScript console (command+J) to see if any errors are reported if nothing appears to happen.
Copy link to clipboard
Copied
Upon clicking OK in the custom calculation JavaScript, the Calculate tab still indicates "Value is not calculated", as it does when I use the simplified notation ...
Copy link to clipboard
Copied
It's either a problem with the PDF you're working with or Acrobat. You can try doing a test with another simple PDF form that just contains a single input field and the calculated field.
If that doesn't work either, then be sure you have the latest Acrobat update, and if it doesn't work try repairing, and if that doesn't work try reinstalling.
Copy link to clipboard
Copied
I opened an empty pdf (Create PDF > Blank Page), created 2 fields (via Prepare Form) and tried the operation again: simplified notation and custom calculation JavaScript lead again to the same result
I updated Acrobat Pro to version 15.16.20045 ... issue still there.
I then uninstalled and reinstalled Acrobat via Cloud Creative ... issue still there.
Copy link to clipboard
Copied
What happens when you use a external javascript editor?
Copy link to clipboard
Copied
Not entirely sure that this answer your question: I can execute commands using the JavaScript Console in Chrome ...
Copy link to clipboard
Copied
In Acrobat you can use an external JavaScript editor. In the preferences of Acrobat you can specify this.
Copy link to clipboard
Copied
YES!!!
I used Emacs as the Editor and the simplified notation now works!
However, it seems like I need to quit Emacs and not just close the tab with .js file each time.
This is a bit annoying because I use Emacs for many other things too.
For now, this is a very good fix, though I'd like to understand why it was not working with Acrobat JS editor ...
Thanks a lot Bernd!
Copy link to clipboard
Copied
NicolasFlagey wrote:
...
For now, this is a very good fix, though I'd like to understand why it was not working with Acrobat JS editor ...
Looks like pressing the OK button acts as a Cancel.
Copy link to clipboard
Copied
Hi.
Be sure that the first checkbox (about calculation) is ticked in Preferences : Form
Copy link to clipboard
Copied
Yes, it is checked by default.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now