How to subtract in a calculation in Acrobat Pro 9

Ask a Question related to Adobe Acrobat Macintosh, Design and Development.

  1. #1

    Default How to subtract in a calculation in Acrobat Pro 9

    I'm building a pdf with some calculations. I can do a 'sum, product,average,minimum,maximum'. But how do i subtract 2 fields?
    sander_wessel@adobeforums.com Guest

  2. Similar Questions and Discussions

    1. serious acrobat 8 calculation error
      anyone else having trouble with resetting the order of calculations in acrobat 8.0.0? it does not stick for me at all. i set the order, then hit ok....
    2. Calculation
      Hi, I'm trying to take data from my database and add them (like field 1 + field 2). Somehow, it doesn't seem to be working. Anybody would know a...
    3. Calculation based on calculation
      I'm new to Acrobat 5.05 and Javascript... I have a simple issue/question: There are 3 columns, QUANTITY, EACHES COST, LINE TOTAL As the...
    4. Doing a simple calculation?
      Hi - I would like to multiply a number by another number that is entered by the user. I have made a non-working example....
    5. Calculation Help
      Hi there, Here's what I am trying to do: I have two fields on a form. One for Estimated $ and one for Acutal $. I would like to do this: If the...
  3. #2

    Default Re: How to subtract in a calculation in Acrobat Pro 9

    You will need to use JavaScript in a field's custom calculation script. For example:


    // Get first field value
    var v1 = getField("Text1").value;

    // Get second field value
    var v2 = getField("Text2").value;

    // Set this field value equal to the difference
    event.value = v1 - v2;


    You would replace "Text1" and "Text2" with the names of the fields you've set up.

    George
    George_Johnson@adobeforums.com Guest

  4. #3

    Default Re: How to subtract in a calculation in Acrobat Pro 9

    I should not have said you *need* to use JavaScript, because you can also use the "simplified field notation" option, but as you come to do more than the simplest of calculations, JavaScript is what you'll need.

    If you want to use the simplified field notation option, you'd enter:


    Text1 - Text2




    but you'd replace Text1 and Text2 above with the names of your fields.

    George
    George_Johnson@adobeforums.com Guest

  5. #4

    Default Re: How to subtract in a calculation in Acrobat Pro 9

    your the best, gonna try it out!
    sander_wessel@adobeforums.com Guest

  6. #5

    Default Re: How to subtract in a calculation in Acrobat Pro 9

    works!
    sander_wessel@adobeforums.com Guest

  7. #6

    Default How to subtract in a calculation in Acrobat Pro 9

    Is there something that I can add to this that would not print a '0' in the field if both text1 and text2 don't have any data entered in them?

    Thanks!

    You will need to use JavaScript in a field's custom calculation script. For example:


    // Get first field value
    var v1 = getField("Text1").value;

    // Get second field value
    var v2 = getField("Text2").value;

    // Set this field value equal to the difference
    event.value = v1 - v2;


    You would replace "Text1" and "Text2" with the names of the fields you've set up.
    Unregistered Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139