2 Replies Latest reply on Dec 2, 2011 4:32 PM by StevenLeuck

    Need help with simple if/then script

    StevenLeuck

      I'm trying to replicate a simple excel if/then statement into a PDF form. Have tried several things but am just not a Java Scripting guy.  Was hoping I could get some help from the community.

       

      I have three boxes that contain cost information. They are labeled LaborCost, MaterialCost & EquipmentCost. Later in the form I have two different output boxes for the sum off my first three boxes.  One if it's a positive number and the other if it's a negative number.  In Excel forumla language this is what the each of the boxes would read as:

       

      For the 1st result if it's a positive number: @if(+LaborCost+MaterialCost+EquipmentCost>0,+LaborCost+MaterialCost+EquipmentCost,0)

       

      For the 2nd result if it's a negative number: @if(+LaborCost+MaterialCost+EquipmentCost<0,+LaborCost+MaterialCost+EquipmentCost,0)

       

      I'm thinking this should be a simple thing to write out but I'm just not familiar with the proper language sets. 

       

      Your colletive help is VERY appreciated.

       

      Steven