Help custom calculation

I need help to write a custom calculation.  That's what I need: I have four boxes (Tone4, Tone1, Tone3, Tone2).  Each box is worth its value (ie. If Tone4 is activated, it should give me 4 points).  How can I write a script that will give me the right value for the checkboxs?

Tone2 Tone1 ToneScore Tone3 Tone4

x                                                            4

or

Tone2 Tone1 ToneScore Tone3 Tone4

x                                             3

or

Tone2 Tone1 ToneScore Tone3 Tone4

x                               2

or

Tone2 Tone1 ToneScore Tone3 Tone4

x               1

or

Tone2 Tone1 ToneScore Tone3 Tone4

0

Why these boxes are named differently? If they are part of an exclusive group (that is to say, you should not check more than one at a time) then they should have the same name but different export values. Then, you can simply set the desired values as the values of export for each box and use this code as the custom calculation of ToneScore script:

Event.Value = this.getField("Tone").value;

If (event.value is "Off") event.value = 0;

Tags: Acrobat

Similar Questions

  • Need help custom calculation Script

    I need to make a script are a column of fields based on or no information found in another column of fields is the same or specific text. Please find below the screenshot of what I would like that to be done.

    I would like a sum of all the amounts that had Code A...

    You can use this script as of 'SumOfA ': custom calculation script

    var total = 0;
    for (var i=0; i<=2; i++) {
        if (this.getField("p1TC."+i).value=="Code A")
            total+=Number(this.getField("p1RecIn."+i).value);
    }
    event.value = total;
    

    You can adjust easily to the other field as well.

  • Help with a custom calculation for rounding up/down in Adobe Pro

    Hello!  I've never written a custom calculation, so I'm lost; could someone help me please write one round to high-low a.50/.49 with this field name:

    CreditedTotalLocal + OtherHE

    For example, if the value of this field, which is the result of the function "value is the sum of the (+) of the following fields" on two fields named CreditedXXXXLocalHE and CreditedOtherHE - between 3.0 and 3.49, this field should be 3.0.  If the value is 3.50 to 3.99, the field should show 4.0.

    I'm sure it's very simple, but I've tried some things from this and other forums without success.  Help, please!

    Thanks in advance,

    Kim

    Instead of using the "field is the sum of the following fields:" or him simplified "Field Notation" you need a custom as a calculation script

    function myRound (n, d)
    {
    / * By d. P. story
    http://Math.uakron.edu/~dpstory/acrotex/elementary/rounding.PDF
    */
    n = String(n).replace(/^,$/g,""); "
    d =-1 * d
    var m = Math.pow(10,d);
    n * = m;
    n = Math.round (n);
    n / m =;
    d = ( d > 0 ) ? d: 0;
    n = n.toFixed (d);
    return n;
    }

    var nResult = this.getField("CreditedXXXXLocalHE").value + this.getField("CreditedOtherHE").value;
    Event.Value = myRound (nResult, 0);

    or

    function DoubleRound (nValue, nDec)
    {
    var nResult = Math.round (value * Math.pow (10, nDec + 1)) / Math.pow (10, nDec + 1);
    return Math.round (nResult * Math.pow (10, nDec)) / Math.pow (10, nDec);
    }

    var nResult = this.getField("CreditedXXXXLocalHE").value + this.getField("CreditedOtherHE").value;
    Event.Value = DoubleRound (nResult, 0);

    The above two functions to round the values decimal, myRound use - Dec for the decimal value to be rounded so that the DobuleRound use the positive value for the decimal number or powers of 10 as the 1,000 with the 3 myRound and -3 for DoubleRound.

  • Custom calculation script % help

    What is the custom calculation script to arrive at a percentage of penetration between two fields? Example: 50 / 100 = 50%

    The simple notation of field: field 1 / field 2

    Custom script:

    var v1 = + this.getField ("Field 1") .value;

    var v2 = + this.getField ("Field 2") .value;

    If (v2 == 0) event.value = "";

    else event.value = (v1 / v2);

  • Is it possible to convert excel function if (and a custom calculation script

    Our field staff use many Excel files for project documentation.  Our organization moves for iPad instead of laptops and we found that a PDF file to be filled on-line is a great resource for our staff.  I have created several of these forms that contain multiple lines and I just starting to learn how to write custom calculation scripts.  I have a more complex than most calculation and I don't know if this can be written in script.

    = IF (I6 < 0.7, G6 * 0.8, IF (AND (I6 > = 0.7, I6 < 0.8), G6 * 0.85, IF (AND (I6 > = 0.8, I6 < 0,9), G6 * 0.9, IF (AND (I6 > = 0.9, I6 < = 1,1), G6 * 1, IF (AND (I6 > 1.1, I6 < = 1,2), G6 * 1.1, IF (AND (I6 > 1.2, I6 < = 1.3), G6 * 1.15, of"extra work"))))))

    I6 is OverdepthRow1

    G6 is WithDowelsRow1

    I think I understand how to get started

    var v1 = get.thisField("OverdepthRow1").value;

    var v2 = get.thisField("WithDowelsRow1").value;

    if(v1<0.7) {}

    var result = v2 * 0.8

    Event.Value = result}

    ElseIf (v1 > = 0, 7 - now I don't know what to do!)

    I hope that I used the correct brackets and braces in the right places.

    I appreciate your help and your advice.

    Thank you

    Rhonda

    I'm sorry, I made a mistake with the first two lines. I have corrected a problem but introduced another. They must be:

    var v1 = + getField("OverdepthRow1").value;

    var v2 = + getField("WithDowelsRow1").value;

  • If/Then converted to a custom calculation Script

    Can someone help me convert = IF (A2 - A1 > 0, 0, A1 - A2) in a customized for use in an Adobe form calculation Script?

    Thank you!

    If A1 and A2 are field names, then the custom calculation script might look like:

    (function () {}

    Get the field values as numbers

    var A1 = + getField("A1").value;

    var A2 = + getField("A2").value;

    Set the value of this field

    Event.Value = A2 - A1 > 0? 0: A2 - A1;

    })();

  • Convert the IF function in the custom calculation Script

    Can someone help me with 'IF(Line7<Line8) Line7, framework8' conversion in a custom calculation Script?

    var L7 = Number(this.getField("Line7").value);
    var L8 = Number(this.getField("Line8").value);
    event.value = (L7		   
  • Custom calculation - multiple if statements

    Hi guys

    I'm stuck with a simple If statement. New to JavaScript.

    I have a text field, drop-down "Gender" field "field" and the text field 'risk '.

    In the 'risk' text field, I need to have a custom calculation script to know if 'Male' > = 45 or female > = 55, risk + 1.

    I currently have the use of this:

    Event.Value = "";

    var a = + this.getField ("Age") .value

    var b = this.getField ("Gender") .value +


    If (a > = 45 & & b = "Male") event. Value = '+ 1'

    ElseIf (a< = 45 & & b = "Male") event. Value = '0'

    If (a > = 55 & & b = 'Female') event. Value = '+ 1'

    ElseIf (a< = 55 & & b = 'Female') event. Value = '0'

    Any help will be appreciated.

    I notice another error. You are attempting to convert the value of sex together with the sign, even if it is not. This generates an error and prevents your working code.

    Here is the fixed code:


    var a = +this.getField("Age").value;
    var b = this.getField("Gender").value;
    
    if (a>=45 && b=="Male") event.Value = "+1";
    else if (a<=45 && b=="Male") event.Value = "0";
    else if (a>=55 && b=="Female") event.Value = "+1";
    else if (a<=55 && b=="Female") event.Value = "0";
    else event.value = "";
    


  • Custom calculation script

    Hello

    I have some problems eiditing my custom calculation scripts.

    at present, there are: ColorField ('IncubatorLow', ValidateMinMax ('IncubatorLow', 400, 1000) & & ValidateOrder ('IncubatorLow', 'IncubatorHigh'));

    I want to change it

    If (event.value > = 400 & & event.value < = 1000) event.target.textColor = color.black;

    Else if (event.value > 1001) event.target.textColor = ["RGB", 0.5, 1, 0];

    Else if (event.value < 399) event.target.textColor = ["RGB", 0.5, 1, 0];

    But whenever I save my pdf file, it keeps the old one? Although even I tried to delete, lock and so on?

    Under java script, I can't know what is may be the course?

    Any ideas? Thanks in advance!

    Found under Java Script: ColorField runs by Custom Caluclations a string. But if I do one for example a new java script for CustomColors - and change of ColorFields to CustomColors.
    And then save the pdf file, it always uses the Colorfield?

    Just solved the problem.

    The form field name: IncubatorLow - IncubatorHigh - now, I just called them: IncubatorLowColor - IncubatorHighColor, then change the java script for validationminmax and change the colors for my 'java script' CustomColors.
    Can register with it back to the original script.

    I do not understand why change the field can solve it, but it has

  • Mileage reimbursement form (custom calculation)

    I am trying to create a script to custom calculation for a mileage reimbursement form. I have a box titled 'engine miles' and I would like to only by the amount of 2014 de.56 IRS for a refund 'total '. If someone has a formula for this it would be greatly appreciated!

    Create a hidden field with this value (remember to use it as default), and then simply use the built-in function of product in the tab calculate to get the result of the multiplication of these two fields. This will make much easier to edit the file in the future, if need be.

  • As a custom calculation, Min and Max with 2 var?

    Is it possible in a custom calculation form select MIN (var1, var2) but a max of 8000. Any ideas would be greatly appreciated?

    The calculation script could be something like:

    Get the values of fields, as strings

    var s1 = getField("v1").valueAsString;

    var S2 = getField("v2").valueAsString;

    If (s1 & s2) {}

    Event.Value = Math.min (8000, s1 + s2);

    } else {}

    Event.Value = 0;

    }

  • Character limit to the custom calculation Script?

    Hello. I have a document that has a text form field. I want to run a custom calculation script which basically says if field 'Number group' = xxxxxxx, so the 'Group name' field should = ABC company.

    I have a list of almost 575 group numbers and names that I need to put in the script. And I have the script works fine, but I'm guessing that there is a limit of characters for the field script? It doesn't let me put my complete list in there.

    Any suggestions on how to work around this problem?

    Thank you

    Brandy

    Yes, there is a character limit for internal JS Editor. The round it is to use an external, such as Notepad.

    Do go to Edit - Preferences - JavaScript and select "Use the external JavaScript editor" and then select the application you want to use.

    Don't forget, however, that you must close the external file each time that change you it if you want to update in the PDF file.

  • Help with tab script and auto custom calculation

    I have implemented a two-page order form in Acrobat, based on an InDesign exported to PDF and filled it with the fields for 30 items that can be ordered.  Each item can be ordered has a color, size, quantity, unit price and Total point (the last two are read only) field.  To the point Total, I used "value is the product of Quantity.x, Price.x of the unit") calculation and to calculate the subtotal, "value is the sum of the Total of the order of the day.

    My first problem is that the scope of subtotal does not reflect the exact amount I have label off a quantity field and enter additional data on the order form.  I would like for the date to be included in the subtotal as soon as it is seized.  I read a script custom hits (tab the cursor on the following fields after the form data of types of recipients in an area of the car) which could deal with this problem, but one) I can't find the script and b) which should be formatted custom for a field that must be the number in the format.

    My second problem is coming up with a custom to variable shipping rates, calculation script based on the subtotal:

    up to $25 - $6; 25.01 $ - $75 = $11,50; $75.01.00 - $125.00 = $15.00

    125,01 $ - $200.00 = $20.00; 200.01 $- $300 = $25.00; $300.01 - $400 = $30.00

    $401,01 - $600 = $50

    I would like to have two radio buttons, one for select Pickup (no charge) and the other to select priority mail delivery - the option button that selects priority mail shipping will show the amount of shipping in a separate, called text box shipping charges.

    I also need a calculation that adds 5% of the subtotal more ShippingFee, if people pay by credit card.  I was hoping that a calculation simple field would take care of it.  (Subtotal + ShippingFee) *. 05)

    For any help or suggestion would be appreciated.  If I need to download the form, I can do this, even if I need to know how to do this.

    See what Bill.

  • Need help with custom calculation Script

    Hey everybody.  I'm using Acrobat X Pro and stumbling a bit on the syntax of the following equation.  I need to add the value of "Cell1" & "Cell2" then add the value of "Cell3.  However, the value of "Cell3" is entered by the user and specifies a percentage of the sum of "Cell1 &"Cell2".  For example: If the user enters "3" in "Cell3" I need the value returned at 3% of the sum of "Cell1" + "Cell2".  If the user enters "9" in "Cell3" I need the value returned for "Cell3" 9% of the sum of "Cell1 and Cell2" and the end result should be the sum of "Cell1 Cell2 + Cell3.  In more detail:

    If "Cell1" = "Cell2" $ 500 = $500 and "Cell3" = '3' then I need the returned value to be $1030,00.

    I hope this makes sense. Here's what I have so far, but alas, it does not work.  Any help would be GREATLY appreciated.

    Get the first value in the field, as a number

    var v1 = + getField("Cell1").value;

    Get the second field value, as a number

    var v2 = + getField("Cell2").value;

    Get the value of a field, a number transformation

    var v3 = + getField("Cell3"/100).value;

    Calculate and set the value of this field for the result

    Event.Value = v3 + (v1 + v2);

    Thank you

    Solan

    I have posted a reply, but realized that it wasn't what you wanted. There is some confusion about what you want for Cell3. A hand, you say that the user enter a vaule in the area, but them you say you want its calculated value based on what the user has entered and two other field values. It seems to me Cell3 should be the domain that the user enters the percentage, and the calculated field (Cell4) script could be:

    Get the first value in the field, as a number

    var v1 = + getField("Cell1").value;

    Get the second field value, as a number

    var v2 = + getField("Cell2").value;// get treatment field value, as a number

    Get the percentage

    var v3 = + getField("Cell3").value;

    Calculate and set the value of this field for the result

    Event.Value = (1 + v3 / 100) * (v1 + v2);

  • help with custom calculation / boxes

    Hello.

    I'm trying to link the boxes for a total of overall points as follows:

    Question1 [] yes [] no

    Question2 [] yes [] no

    1 point if either 'Yes' is selected. (Max 1 point only)

    Question3 [] yes [] no

    Question4 [] yes [] no

    2 points in total for each '' Yes. '' (Maximum 4 points)

    I set each box to a value of exports of 1.

    I have a score box "box2".

    // first section questions
    // set vars
    var points = this.getField("YesOne").value + this.getField("YesTwo").value;
    // if then
    if ((points > 0)) {this.getField("box2").value = 1} 
    else {this.getField("box2").value = 0};
    

    I got stuck on the first part, because it doesn't work as I said above, any help would be appreciated.

    I am trying to post the actual PDF, but I can't find a way to put it in this ad...

    Thank you!

    Here is an example with all 3 approaches and the display of the value of each field:

    Boxes amount

Maybe you are looking for

  • Photo slide show on digital frame Journe Air 1000 RSS feeds

    Hello I just bought a Journe Air 1000 digital photo frame kajigga. I want it as a Christmas gift for my parents. All I want to do is automagically get a slideshow of pictures from a file server via the LAN. NO internet in the site Flickr or Picasa. L

  • Problem with new Skype updated for iPad 2 version 4.0.1325

    Since the upgrade to the new version, I was not able to do a video Skype or voice call on my iPad 2 anyone else having trouble? I am able to send messages from Skype.

  • HP Envy 120: Replacement of printhead HP Envy 120

    My two computers are connected wirelessly to my HP Envy 120.  A computer runs on Windows 7, the other on Windows 10. Because I have tried all the advice for my problem: the printer cannot print black ink - I'm now looking to replace the printhead bef

  • names of

    How to provide the names of files and folders correctly

  • Drivers XP for HP Pavilion dv6215ea

    Hi all! I need drivers for HP Pavilion dv6215ea xp. On the page (http://h10025.www1.hp.com/ewfrf/wc/softwareList?os=228&lc=it&dlc=it&cc=it&product=3366705&lang=it) xp driver is not something useful. On vista (http://h10025.www1.hp.com/ewfrf/wc/softwa