Answered
If/Then Converted to a Custom Calculation Script
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!
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;
})();
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.