Copy link to clipboard
Copied
I am currently trying to get 2 of the same fields to look for a discrepancy between the two.
The formula I am using is:
function _Sum() {
var total = 0;
for (var count=0; count<_Sum.arguments.length; count++) {
if ( _Sum.arguments[count] )
total += _Sum.arguments[count];
}
return(total);
}
event.value = _Sum(((this.getField("discrepancy")).value*(-1)))
Is there something I am missing. I am also trying to get a field to still be editable and still calculate the numbers. What should I do to get this to work properly?
Copy link to clipboard
Copied
What's the point of a sum function if you're only providing it with one
parameter?
On Thu, Mar 10, 2016 at 7:20 PM, nathanh91795179 <forums_noreply@adobe.com>
Copy link to clipboard
Copied
That is the only parameter I need in this form. The fields I am looking for a discrepancy in are identical fields
Copy link to clipboard
Copied
I don't follow... If they're identical (with the same name?) how can there be a discrepancy?
If you want this field to just have the same value as the other field, only multiplied by -1, simply use this code:
event.value = Number(this.getField("discrepancy").value) * -1;
Copy link to clipboard
Copied
What I have is a text field that needs to equal three different text field subtracted from each other but still have the field to be able to be edited manually.
Copy link to clipboard
Copied
I don't see how your code achieves anything close to that...
Find more inspiration, events, and resources on the new Adobe Community
Explore Now