Copy link to clipboard
Copied
Can anyone help me convert =IF(A2-A1>0, 0, A2-A1) into a Custom Calculation Script for use in an Adobe form?
Thank you!
If A1 and A2 are field names, then the custom calculation script could look like:
(function () {
// Get the field values, as numbers
var A1 = +getField("A1").value;
var A2 = +getField("A2").value;
// Set this field's value
event.value = A2 - A1 > 0 ? 0 : A2 - A1;
})();
Copy link to clipboard
Copied
event.value = A2-A1>0 ? 0 : A2-A1;
Copy link to clipboard
Copied
If A1 and A2 are field names, then the custom calculation script could look like:
(function () {
// Get the field values, as numbers
var A1 = +getField("A1").value;
var A2 = +getField("A2").value;
// Set this field's value
event.value = A2 - A1 > 0 ? 0 : A2 - A1;
})();
Find more inspiration, events, and resources on the new Adobe Community
Explore Now