Professional Web Applications Themes

How to subtract in a calculation in Acrobat Pro 9 - Adobe Acrobat Macintosh

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

  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. #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

  3. #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

  4. #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

  5. #5

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

    works!
    sander_wessel@adobeforums.com Guest

  6. #6

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

    George - thank you so much! I didn't ask the question, but I certainly benefited from your assistance. Thanks so much! -dave
    Dave_Rip@adobeforums.com Guest

  7. #7

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

    How would you write this if you were wanting to subtract dates? I'm using Acrobat 9 as well. Thank you!
    BDow@adobeforums.com Guest

  8. #8

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

    best solution evar. worked fine for me. thanks
    __________________________________________________ ______________
    movie phim online <http://coiphimhay.com> media... music nhac online <http://coiphimhay.com/phimonline.action?tab=3> the world of wholesale fashion <http://fashion4us.com> and models wholesale clothing <http://fashion4us.com> and lovely phim han quoc <http://phimhanquoc.us> film..?!!
    John_Lekawaski@adobeforums.com Guest

  9. #9

    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

  10. #10

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

    Quote Originally Posted by Unregistered View Post
    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.
    This worked perfectly in Adobe Acrobat 7.0 Professional as well. Thank you!
    Unregistered Guest

Similar Threads

  1. serious acrobat 8 calculation error
    By ericjameswood@adobeforums.com in forum Adobe Acrobat Macintosh
    Replies: 1
    Last Post: February 1st, 10:56 AM
  2. calculation forms
    By dwebber in forum Macromedia Dynamic HTML
    Replies: 0
    Last Post: August 21st, 06:47 PM
  3. Calculation
    By Kryss2099 in forum Macromedia Flash Data Integration
    Replies: 3
    Last Post: April 7th, 04:08 AM
  4. Calculation based on calculation
    By Point_Man@adobeforums.com in forum Adobe Acrobat Windows
    Replies: 0
    Last Post: April 20th, 03:35 AM
  5. Calculation Help
    By Heidi in forum Microsoft Access
    Replies: 1
    Last Post: July 17th, 09:34 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not 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