Copy link to clipboard
Copied
I am having difficulty with an IF function, =IF(B21>B22,B21-B22,0) this will not work in java. Any help would be greatly appreciated.
Copy link to clipboard
Copied
Acrobat forms use JavaScript and not Excel functions. There is no if function on JavaScript
There is an if statement whose syntax is very different.
Have looked at any JavaScript tutorials or Acrobat scripting tutorials?
Copy link to clipboard
Copied
Yes, I am aware that I cannot use excel functions, I only placed that there as an example. It was the best way I could describe what I am trying to achieve.
I've researched the scripting until my eyeballs burn , so any assistance anyone could offer would be very much appreciated.
Copy link to clipboard
Copied
Assuming that you want this to be a custom calculation script for a field, it could be something like:
// Custom calculation script for text field
(function () {
// Get the field values, as numbers
var B21 = +getField("B21").value;
var B22 = +getField("B22").value;
// Set this field's value
event.value = B21 > B22 ? B21 - B22 : 0;
})();
Change "B21" and "B22" in the getField statements with the actual names of the fields in your form.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now