7 Replies Latest reply: Mar 20, 2012 9:09 AM by jdeutsch1002 RSS

    translate to java

    jdeutsch1002

      Hello

       

      I was wondering if someone would be able to help me convert this to javascript so that I can make this form I'm creating do the math within the text boxes. I know nothing about Java and have not found anysite that will do the translatting for me. If you have the time I would greatly appreciate it.

       

      First formula:

      text box 6 - text box 22 = text box 23

       

      Second formula:

      text box 23 - sum(text box 24 through 31) = text box 32

       

      Again if this takes up to much of your time I will just continue on with the form and not have it do the calculations. Thanks for any help you can offer.

       

      Jennifer

        • 1. Re: translate to java
          try67 ACP/MVPs

          First formula (as the custom calc script of text box 23):

          event.value = +this.getField("text box 6").value - +this.getField("text box 22").value;

           

          Second formula (as the custom calc script of text box 32)::

          var sum = 0;

          for (var i=24; i<=31; i++)

               sum += +this.getField("text box "+i).value

          event.value = +this.getField("text box 23").value - sum;

          • 2. Re: translate to java
            jdeutsch1002 Community Member

            Thank you so much! I will give that a try. Really thank you for your time!!!!!

            • 3. Re: translate to java
              jdeutsch1002 Community Member

              Hey Try67

               

              Sorry to be a pest but it is not entering any values into box 23 or 32. Am I missing something here?? I copied exactly what you had typed into the cust calc fields for the two boxes and it is not filling in any numbers.

               

              Thanks

              Jennifer

              • 4. Re: translate to java
                try67 ACP/MVPs

                Open the JS console (Ctrl+J) and check if there are any error messages.

                • 5. Re: translate to java
                  jdeutsch1002 Community Member

                  Yes and it's rather lengthy:

                   

                  Acrobat Database Connectivity Built-in Functions Version 7.0
                  Acrobat EScript Built-in Functions Version 7.0
                  Acrobat Annotations / Collaboration Built-in Functions Version 7.0
                  Acrobat Annotations / Collaboration Built-in Wizard Functions Version 7.0
                  Acrobat Multimedia Version 7.0
                  Acrobat SOAP 7.0

                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box " + i) has no properties
                  5:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box " + i) has no properties
                  5:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box " + i) has no properties
                  5:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box " + i) has no properties
                  5:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box " + i) has no properties
                  5:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box " + i) has no properties
                  5:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box " + i) has no properties
                  5:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box " + i) has no properties
                  5:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box " + i) has no properties
                  5:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box " + i) has no properties
                  5:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box " + i) has no properties
                  5:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box " + i) has no properties
                  5:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box " + i) has no properties
                  5:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box " + i) has no properties
                  5:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box " + i) has no properties
                  5:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box " + i) has no properties
                  5:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box " + i) has no properties
                  5:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box " + i) has no properties
                  5:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box " + i) has no properties
                  5:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box " + i) has no properties
                  5:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box " + i) has no properties
                  5:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box " + i) has no properties
                  5:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box " + i) has no properties
                  5:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box " + i) has no properties
                  5:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box " + i) has no properties
                  5:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box " + i) has no properties
                  5:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box " + i) has no properties
                  5:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box " + i) has no properties
                  5:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box " + i) has no properties
                  5:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box " + i) has no properties
                  5:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box " + i) has no properties
                  5:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box " + i) has no properties
                  5:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box " + i) has no properties
                  5:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box " + i) has no properties
                  5:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box " + i) has no properties
                  5:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box " + i) has no properties
                  5:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box " + i) has no properties
                  5:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box " + i) has no properties
                  5:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box " + i) has no properties
                  5:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box " + i) has no properties
                  5:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box " + i) has no properties
                  5:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box " + i) has no properties
                  5:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box " + i) has no properties
                  5:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box " + i) has no properties
                  5:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box " + i) has no properties
                  5:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box " + i) has no properties
                  5:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box " + i) has no properties
                  5:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box " + i) has no properties
                  5:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box " + i) has no properties
                  5:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box " + i) has no properties
                  5:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box " + i) has no properties
                  5:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box " + i) has no properties
                  5:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box " + i) has no properties
                  5:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box " + i) has no properties
                  5:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box " + i) has no properties
                  5:Field:Calculate
                  TypeError: this.getField("text box 6") has no properties
                  1:Field:Calculate
                  TypeError: this.getField("text box " + i) has no properties
                  5:Field:Calculate

                   

                   

                  I do have a number in box 6 if that's what that means.

                  • 6. Re: translate to java
                    try67 ACP/MVPs

                    It means there's no field called "text box 6". You must double-check that there's no extra space somewhere, and remember also that it's case-sensitive, so if it's called "Text box 6", it won't work.

                    • 7. Re: translate to java
                      jdeutsch1002 Community Member

                      The boxes name is actually Text6. So I will replace with those exact words. Thanks again! And I just edited it and it works just fine now!! Thanks your insight!!