Skip navigation
jdeutsch1002
Currently Being Moderated

translate to java

Mar 20, 2012 8:15 AM

Tags: #acrobat #pro #7

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

 
Replies
  • Currently Being Moderated
    Mar 20, 2012 8:18 AM   in reply to jdeutsch1002

    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;

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 20, 2012 8:51 AM   in reply to jdeutsch1002

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

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 20, 2012 9:03 AM   in reply to jdeutsch1002

    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.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points