Calculation based on the checkbox is enabled?

I have a form that sub total a group of field. Based on this subtotal I need to calculate a tax of 5% finance, if the box is checked, otherwise the financing costs are zero. Any help would be appreciated. Thank you

You can use this script to custom calculation for the field of cost of funding. Of course, you will need to adjust the field names in the code to match those of your file.

if (this.getField("CheckBox1").value=="Off") {
    event.value = 0;
} else {
    event.value = Number(this.getField("SubTotal").value) * 0.05;
}

Tags: Acrobat

Similar Questions

  • JavaScript to remove the contents of the fields based on the checkbox disabled

    I'm writing a java script to delete the contents of the fields when a checkbox's checked to disabled.  I have a java script to fill in the field when the checkbox is enabled (which works perfectly).  But in the case where the user accidentally checks the field and wants to uncheck the box I would like the content of field that were initially filled from the first java script to be removed/disabled.

    Here is my code:

    Mouse Up Script for the checkbox (function() {}

    Do something if this check box is not selected.
    if(Event.Target.Value==="on") return;

    Copy the values from text previously filled in those other fields.

    getField("AP_Unit").value = Null;
    getField("AP_StreetAddress").value = Null;
    getField("AP_City").value = Null;
    getField("AP_Province").value = Null;
    getField("AP_ZIP").value = Null;
    getField("AP_Country").value = Null;

    })();

    Sorry it works... that make three equal signs "=" means?

    Here is my code

    If {(event.target.value==="Off)"}
    getField("AP_Unit").value =("");
    getField("AP_StreetAddress").value =("");
    getField("AP_City").value =("");
    getField("AP_Province").value =("");
    getField("AP_ZIP").value =("");
    getField("AP_Country").value =("");

    } else {}

    getField("AP_Unit").value = getField("HO_Unit").valueAsString;
    getField("AP_StreetAddress").value = getField("HO_StreetAddress").valueAsString;
    getField("AP_City").value = getField("HO_City").valueAsString;
    getField("AP_Province").value = getField("HO_Province").valueAsString;
    getField("AP_ZIP").value = getField("HO_ZIP").valueAsString;
    getField("AP_Country").value = getField("HO_Country").valueAsString;
    }

  • A drop-down list can do the calculation based on the value selected in a drop down list?

    Form Acrobat X Pro Adobe

    Can I have a drop down list create a calculation based on the value selected in the menu drop-down?

    We have a set lunch and want the user to choose to be "A lunch', 'Lunch B'"C Lunch"or"just the milk. "

    It is for each of the 5 days of the week. There are therefore 5 drop downs, which have all the same 4 above choice.

    If the user chooses among the 3 lunches and then put $2.00 in the total box at the end of the line. If 'Just the milk' may put 0.50 in the box.

    The total area at the end of the line must keep a record of all 5 days and give a total.

    So if someone chooses lunch A LUN, sea and Sun and just milk for Tuesday and Thursday and then the total for this week must be $7,00

    Is it possible by using code or something?

    I did it in Excel, but we need it is an Adobe pdf file.

    TIA

    OK the total box has a 10 all the time to make it look like $ 2.00 for

    everything.

    Before even that I chose something there are 10 in the box.

    I am a newbie to Adobe scripting Total used VB/A .NET etc ' 1980

    However.

    Can you do any debugging in code?

    Initialize the sum

    var sum = 0;

    Make a loop on the drop-down list boxes and add the cost of the invoice sum

    for (var i = 1; i)< 6;="" i="" +="1)">

    Sum += getField("Week1Day"_+_i).value == 'just milk? 0.50: 2,00;

    }

    Set this field to the amount

    Event.Value = sum;

  • Fill in the multiple fields based on the checkbox

    (other questions newb...)

    You want to fill several form fields from or not a checkbox is enabled.

    I now using scripts calculated in the work field. for example:

    If (this.getField("checkbox").value == "Off") {}

    Event.Value = null;

    } else {}

    Event.Value = "ABCXYZ";

    }

    However, it is possible to assign values only from the field box itself?

    Yes, you can do so from the MouseUp event of the checkbox field. It will look something like this:

    if (event.target.value=="Off") {
        this.getField("Text1").value = "";
        this.getField("Text2").value = "":
    } else {
        this.getField("Text1").value = "ABCXYZ";
        this.getField("Text2").value = "123456":
    }
    
  • AutoFill based on the checkbox

    I'm relatively new to any idea in Javascript and Formcalc for forms of script. I created a form in need of some expensive attention. What I'm trying to do is autopopulate text fields based on the box, if it is enabled or not.

    Example: Once the property information - property name, street address, city, State and zip code (at the top of the form) are filled. If the box is checked in the section information of client (below), it will enter information according to the property information in the fields of the address below in the assigned text fields.

    Here is my code Javascript (not exhaustive):

    FLContract. #subform [0]. PayerName::calculate - (JavaScript, client)

    var a =' '

    If (this.getField ("CheckBoxPropertyInfo") .value == 1)
    {
    a = propName.Value
    }
    Event.Value = has

    Capture.PNG

    Enter this slot option 'Change' to the editor script for the checkbox control. just rename your fields appropriately. The second 'if' will reset the fields if they accidentally clicked on it. Name [1] is the field you want the box to be filled. 'Name' is the original field.

    If (this.rawValue == '1') {}

    this.resolveNode("Name[1]").rawValue = this.resolveNode("Name").rawValue;

    this.resolveNode("Address[1]").rawValue = this.resolveNode("Address").rawValue;

    this.resolveNode("City[1]").rawValue = this.resolveNode("City").rawValue;

    this.resolveNode("State[1]").rawValue = this.resolveNode("State").rawValue;

    this.resolveNode("ZipCode[1]").rawValue = this.resolveNode("ZipCode").rawValue;

    this.resolveNode("Country[1]").rawValue = this.resolveNode("Country").rawValue;

    }

    If (this.rawValue == '0') {}

    this.resolveNode("Name[1]").rawValue = "";

    this.resolveNode("Address[1]").rawValue = "";

    this.resolveNode("City[1]").rawValue = "";

    this.resolveNode("State[1]").rawValue = "";

    this.resolveNode("ZipCode[1]").rawValue = "";

    this.resolveNode("Country[1]").rawValue = "";

    }

  • Make editable field when the checkbox is enabled, otherwise given value read-only

    I try to make a PDF form to fill out, and a document existing, using Acrobat Pro, which does the following:

    Form is designed to allow customer agrees to buy a personalized work of art.

    The work has a base price, ArtworkPrice. (The ArtworkPrice field is editable)

    The customer can choose to include a picture frame. (AddFrame 'Yes' box.)

    Choose 'Yes' to add a frame, adds an amount.  (The FramePrice field is editable only if AddFrame checkbox is enabled)

    Otherwise, leaving unchecked AddFrame fills the FramePrice field with a value of 0.00.

    The TotalPrice is calculated as the sum of the fields FramePrice and the ArtworkPrice. (The TotalPrice field is read-only)

    So... this part of the form looks essentially this:

    AddFrame? [] Yes

    ArtworkPrice _ $ + FramePrice $_ = TotalPrice $_

    The FramePrice field must be 0.00 (and not editable) at all times unless the AddFrame checkbox is selected.

    How can I do this?

    Add this code to the MouseUp of AddFrame event:

    If (this.getField("AddFrame").value == "Off") {}

    this.getField("FramePrice").value = 0;

    this.getField("FramePrice").readonly = true;

    } else {}

    this.getField("FramePrice").value = "";

    this.getField("FramePrice").readonly = false;

    }

  • Tax calculation based on the user in the box input and displaying the result.

    Thanks to WhyIsThisMe for starting me on my first draft script & Jono! I'm almost there with my purchase requisition form (90% manufactured from the tutorial).  Everything works except for the taxable column

    form.JPG

    I can't understand the correct syntax to check the value of the checkbox in the column taxable and then do the math for the tax based on user input in the field % tax

    (total * stateTaxPercent / 100)

    Essentially, I want to make the calculation only the taxable = 1, and then display the cumulative tax in the tax field.

    Should I use mouseup as trigger to perform the calculation of the tax and save the result as a variable and displays the variable in the tax field? Then if another taxable box gets checked, I could add the new calculation of the variable. Not sure whether in an elegant way to get there.

    ?

    I would put the following text in the change event of each taxable check box (in formcalc):

    If ($ == 1) then

    tax = tax + (amount * 0,0825)

    ElseIf ($ == 0) then

    tax = tax - (quantity * 0,0825)

    endif

    (where 'tax' is what you called your total tax box and the 'amount' is what you called your box of price).

  • Calculation based on the box help please...

    I'm doing a text box run a calculation based on whether or not a radio button is checked or not.

    If the radio button named 'Built' in the group 'Type of Quilting' is checked, then the text box "By squirting the load" must find the value of the field "Total Square Inches" and multiply this total by 0.015 and show the new total in the text box as a monetary value, if the 'Casting' radio button is not checked the value in the field 'Charge of basting"should be"- 0 -".

    I can get the calculation that I want this:

    var v1 = getField("Total_Square_Inches").value; Event.Value = v1 * 0.015;

    But how to understand the function of the radio button and "- 0 -"?

    If the name of the field is built, the calculation script could be:

    (function () {}

    Get field values

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

    var v2 = getField("Basting").value;

    Set this field value

    If the check box is selected in function

    If (v2 = 'Off') {}

    Event.Value = 0;

    } else {}

    Event.Value = v1 * 0.015;

    }

    })();

  • Adding conditional based on the checkbox

    I have a field that adds the values of several other fields in the form.  The question I have is how can I add another 2 If a certain checkbox is visible and active?

    Hello

    You would need an if/else statement that looks at the value of the checkbox.

    This could be in the event to calculate the field which displays the answer:

    var tempAnswer = numericfield1.rawValue + numericfield2.rawValue + numericfield3.rawValue;
    
    if (checkbox.presence == "visible" && checkbox.rawValue == 1)
    {
         tempAnswer = tempAnswer + numericfield4.rawValue + numericfield5.rawValue;
    }
    
    this.rawValue = tempAnswer;
    

    You would need to change the object references, etc, but it should give you a structure to work with. We have examples here, some of which include objects with calculation scripts: http://assure.ly/eEPuCM

    Hope that helps,

    Niall

  • How to hide the object based on the checkbox with FormCalc

    Hello everyone - I am very new to FormCalc and struggling to find answers in the Help menu of Adobe Pro.  The shape that I create is long and based on the requirements of option.  Therefore, if an option is not necessary (check box) more of the data fields will not be displayed for the user.

    1: I can do this?

    2nd: it's the correct script:

    If (temp. RawValue is true)

    Then(LowTempLOFF.Presence == visible)

    on the other

    LowTempLOFF.Presence = "Hidden";

    endif

    in the example above my checkbox is named "Temp".

    the object to be hidden, a numeric field is named "LowTempLOFF".

    I've also tried '1' instead of 'True', and 'on' in vain.

    To add, I want the object visible screen only - not print.

    My current error States: the "Temp.rawValue" accessor is unknown

    Appreciate any help!

    You save the dynamic PDF form? Presence changes will not work unless the form is a dynamic

    PDF.

    Paul

  • Fill in the time field, based on the checkbox

    I am trying to find a script to do the following:

    If checkfield.rawValue = "1" (checked)

    timefield.rawValue = (current time)

    If checkfield.rawValue = "0" (unchecked)

    timefield.rawValue = 'null '.

    Any ideas or suggestions would be greatly appreciated.

    Thank you.

    Here's a modified version. Display BBS of the script added additional characters that mess. I moved the code to the change event of the box (I think it's nicer whne the user clicks to see the change rather than leave the checkbox). Validate the e Th message was because you had a pattern on the ground and time resulting does not match. I deleted the template as well as disable the validation script message.

    Paul

  • Creation of calculation based on the result of the drop-down list

    Hello. I hope that someone will be kind enough to help me with some Javascript because it seems that I am too blonde and middle ages to figure out by myself.

    I have a drop-down list box 'Member '. The Yes value is 0. The value is 10.

    Then I have three check boxes. "Day 1" value is 35. "Day2" value is 25. 'Dinner' value is 65.

    If this option is enabled, I want the sum of the check boxes, if they are checked. (for example, total if all checked = 125)

    If no is selected, the value of each check box rose 10. (for example, total if all checked = 155)

    I use Acrobat X.

    Thanks in advance.

    Due to the fact that you want to add a constant number of values if a given condition is met then you will need to use a custom calculation script.

    get the value of the fields

    var cMember = Number (this.getField("Member").value);

    var nDay1 = this.getField("Day1").value;

    var nDay2 = this.getField("Day2").value;

    var nDinner = this.getField("Dinner").value;

    define a varaiable for the sum

    var sum = 0;

    day 1 more SETTINGS

    If (nDay1! = "Off") the sum += (nDay1) Number + cMember;

    day 2 more SETTINGS

    If (Day2! = "Off") the sum += (nDay2) Number + cMember;

    more dinner SETTINGS

    If (nDinner! = "Off") the sum += (nDinner) Number + cMember;

    Event.Value = sum;

    Excel is easy if you would see Microsoft calculations.

  • Change the font color in the field when the checkbox is enabled

    I have a form that contains two (2) text fields that must have the font color changes from black to red when a check box is selected. This would also work if the fill color changes to red when the check box is selected.

    If we have a named checkbox: checkbox and export value: Yes

    and a textbox named: text

    Paste this code in the mouse box event

    -beginning of code-

    checkbox var = this.getField ("checkbox");

    textField var = this.getField ("text");

    If (checkbox.value is 'Yes')

    {

    textField.fillColor = color.red;

    } else

    {

    textField.fillColor = color.white;

    }

    //---------------code End-----------------

  • Calculation based on the option button

    Here, any help would be appreciated. I know enough Javascript to get me in trouble, and that's it.

    I have a form with two radio buttons ('progress' and 'final') in a group called "billing". Below this, I have several calculation fields.

    When the 'progress' is selected, the "undefined_7" field should use the formula (undefined_6) *.10

    If 'final' is checked, the same field must be set to zero.

    With the help of Arobat X Pro.

    Thanks in advance!

    Assuming that the value of exports (aka Value Button, Radio button choice) for two boxes is 'progress' and 'final', the custom calculation script might look like:

    Custom calculation script

    (function () {}

    Get field values

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

    var v2 = getField("undefined_6").value;

    switch (v1) {}

    case "progress":

    Event.Value = v2 / 10;

    break;

    case "final":

    Event.Value = 0;

    break;

    default: / / no radio button is selected (v1 = 'Off') which may never come

    Event.Value = "";

    }

    })();

  • Calculation based on the date, but the year &amp; month on fileds separate.

    Hello
    Simple question:
    I have a table with the SOURCE fields 9i, YEAR, MONTH
    Because I don't have a date field, how I count for example records < 07/2008?

    SAMPLE DATA:
    .
    .
    .
    APPLES; 2008; 06
    APPLES; 2008; 07
    APPLES; 2008; 08
    .
    .
    .

    Thanks in advance for your help.

    Hello
    do you want this?

    with data
    as
    (select 'APPLES' SOURCE ,'2008' yy,'06' mm from dual union all
     select 'APPLES'  ,'2008' ,'07'  from dual union all
     select 'APPLES'  ,'2008' ,'08'  from dual)
    select count(*)
    from data
    where to_date(yy||mm,'YYYYMM') <= to_date('072008','MMYYYY')
    

Maybe you are looking for