4 Replies Latest reply on Aug 8, 2012 9:36 AM by mstout@edwardrose

    "If" forumla help please!


      I am trying to create a conditional or "if" formula in Acrobat.  I have successfully done the same thing in Word, but the same formula will not work in “Simplified Field Notation” and I am not too familiar with JavaScript.


      My fields are "install", "monthly", "day", "dayrate" and "prorate".  ("monthly" and "install" are the only fields that require input from the user.


      dayrate = monthly / 30    day = 31 - install


      I am trying to determine "prorate" based on what is input in "monthly" and "install."  The formula I used in Word to calculate the value for the field “prorate” is “IF(day=30, monthly, day*dayrate).


      Is there a way to do this in Acrobat? I have tried mimicking several other “IF” scripts without success and I’m in a time crunch.  Thank you much!

        • 1. Re: "If" forumla help please!
          gkaiseril MVP & Adobe Community Professional

          The simplified field notation is not JavaScript but uses JavaScript behind the scenes to take the field names and constant numeric values to perform the four basic calculation methods of addition, subtraction, multiplication and divsion. No conditional controls statements, field properties, field methods, or functions are allowed. Field names must start with an alphabetic character and should not include any white space. White spaces are used to determine the break of field name, operations, and constants.  String operations are also not permitted.


          You do not specify the target of the calculation, as it is assumed the target for the result of the calculation is the field for which the calculation is being written.

          • 2. Re: "If" forumla help please!
            mstout@edwardrose Level 1

            Yes, sorry I did not specify.  I know that Simplified Field Notation is not JavaScript.  I was trying to ask if there is a way to do it in Simplified Field Notation (which you answered) and, if not, if someone could provide me with a JavaScript code that would work.  I have found some code for conditional statements, but can't seem to get it to work in my form.


            The target of the calculation is to determine "prorate."


            "prorate" will always equal "day" x "dayrate" unless "day" = 30, in which case "prorate" would equal "monthly" which is an amount entered by the user.


            Let me know if I did not answer your question. Thank you!

            • 3. Re: "If" forumla help please!
              gkaiseril MVP & Adobe Community Professional

              You have a conditional situation and Simplified Field notation can not perform that type of statement, You will need to write a custom JavaScript callculation.

              • 4. Re: "If" forumla help please!
                mstout@edwardrose Level 1

                Yes, I understand that.  I do not know how to write the custom JavaScript and was wondering if someone could help me with that or lead me in the right direction.  As I stated, I have researched conditional JavaScript codes and tried tweaking them to work in my form without succes.  Thanks again.