Planet PDF Forum Planet PDF Forum
  New Posts New Posts RSS Feed - calculate sum only with positive valus
  FAQ FAQ  Forum Search   Register Register  Login Login


Hi, welcome to the Foxit Planet PDF Forum. If you have PDF or Adobe Acrobat questions then the right place to ask them is here, in this forum.

calculate sum only with positive valus

 Post Reply Post Reply
Author
ilnobile View Drop Down
New Member
New Member


Joined: 12 Jan 2016
Points: 2
Post Options Post Options   Quote ilnobile Quote  Post ReplyReply Direct Link To This Post Topic: calculate sum only with positive valus
    Posted: 12 Jan 2016 at 8:39am
Hi there,
I'm a dummy and I need an help to calculate a sum of three fields of trhee different forms only if there values are positive.
I try put this code on the calculate event of the textfield that should contain the sum:

if(Subform34.valore11.rawValue>0){
this.rawValue = this.rawValue + Subform34.valore11.rawValue;
}

if(Subform36.valore11.rawValue>0){
this.rawValue = this.rawValue + Subform36.valore11.rawValue;
}

if(Subform37.valore11.rawValue>0){
this.rawValue =this.rawValue + Subform37.valore11.rawValue;
}

it doesn't works 
someone can help me please?

Back to Top
Sponsored Links


Back to Top
gkaiseril View Drop Down
Senior Member
Senior Member


Joined: 15 Jul 2011
Location: USA
Points: 4076
Post Options Post Options   Quote gkaiseril Quote  Post ReplyReply Direct Link To This Post Posted: 12 Jan 2016 at 10:00pm
You might want to recheck the Scripting reference included in LiveCycle.

I would not use "this", since the word "this" defines the document object.

For the current field's value I have only seen "$.rawValue".
Back to Top
ilnobile View Drop Down
New Member
New Member


Joined: 12 Jan 2016
Points: 2
Post Options Post Options   Quote ilnobile Quote  Post ReplyReply Direct Link To This Post Posted: 13 Jan 2016 at 7:12am
many thanks for the answer,
I solved the problem with this code that works well:
var v = 0;

if(Subform34.valore11.rawValue > 0){
    v = v + Subform34.valore11.rawValue;
}

if(Subform36.valore11.rawValue > 0){
    v = v + Subform36.valore11.rawValue;
}

if(Subform37.valore11.rawValue > 0){
    v = v + Subform37.valore11.rawValue;
}

this.rawValue = v;
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.10
Copyright ©2001-2017 Web Wiz Ltd.

This page was generated in 0.031 seconds.