Calculations of edition and checkbox help (JavaScript novice needs help)

Hey everyone, so I'm having a few problems with the implementation of my adobe calculation using the fields. I don't know a lot about the use of JavaScript so that any help would be appreciated.

  1. This is my first problem in simplest form:
    • I have a field (F1) and a field that uses F1 to calculate a result (F2).

F1 = 18

F2 = ((F1-10)/2) (which in this case, the answer is 4)

Now where I will have questions, it's that I need a symbol of the addition to appear before the "F2" (the result here would be + 4)

I took a picture of how I did it in Java where it would be useful to answer the question:

t1.png

2.

My second problem is that I want a checkbox to change the values if it is pressed. I'm still lost on this part, but all this I want to do is the following:

  • If the checkbox is unchecked nothing happens. If the box IS checked, then I would add 2 to another field. If the box IS checked that the + 4 would become a + 6, so using the above problem.

Now since this is my first time editing an adobe form and using the fields for calculations I'm quite lost on the boxes and what script would go inside my custom fields properties calculation script. I don't know much outside of what I learned today about JavaScript so that any help would be greatly appreciated.

I thank in advance anyone who responds.

The custom for the field F2 calculation script could be something like:

(function () {}

Get field values

var v1 = getField("F1").value;

var v2 = getField("CB1").value;  Check box value. "Off" otherwise we'll pick

Add 0 or 2 depending on the value of the checkbox

var v3 = v2 = "Off"? 0: 2;

Perform the calculation

var result = (v1 - 10) / 2 + v3;

Add a '+' if positive

If (result > = 0) {}

result = '+' + result;

}

Set the value of this field

Event.Value = result;

})();

This could be simplified, but it should help you get started. Replace "F1" and "CB1" with the actual names of the fields.

Tags: Acrobat

Similar Questions

Maybe you are looking for

  • Proxy in firefox does not really work!

    I live in Thailand and several Web sites are blocked by the Government.Well I tried to use a proxy and checked my IP to samair.ru and displays the ip address of the proxy.Then I surfed with this proxy. But several Web sites are still blocked and you

  • Skype stopped loading, urgent

    Yosemite, 10.10.5 MacBook Pro, mid-2014 Skype 7.17.377 I open Skype, type credentials, press Sing in, and then it just hangs. Help, urgent.

  • 320-320: 1030-1030

    Hello, I was wondering what to look for if I wanted to update my 320-1030 in regards to a motherboard and processor? I was contemplating upgrading the CPU for an A8-3820 on the existing card, but now I'm wondering if it is possible to move to a faste

  • where's my emails from 2005,04,03?

    I can not access my old emails.  Why?

  • How to stop FM radio play

    How the radio to stop playback and a song to stop playing, so there is nothing playing on the "rocket"? Any ideas?