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 = "";

}

})();

Tags: Acrobat

Similar Questions

  • How uncheck you the option buttons in Adobe Acrobat Pro XI?

    How uncheck you the option buttons in Adobe Acrobat Pro XI?

    OK, so I have a three sets of radio buttons each three choices, so, basically, it looks like this

    Cheques:          (    )          (     )          (     )

    Deposit slips: () ())

    Envelopes:        (    )          (     )          (     )

    In case anyone is confused, () are radio buttons. Basically, I want radio buttons to act as check boxes, I want to be able to click them and outside. I don't want us boxes because I want them to be circles and not square. Is there a way to do this? Maybe using javascript, what code would be?

    Radio button names: QTY.

    XQTY

    XPrice

    Thanks in advance guys

    You don't have to use a script. I rarely use the option button because they cannot normally be deselected once in the Group has been selected, but here's a backdoor method I use in the mouse event to the top:

    Uncheck the box if the SHIFT key is pressed while clicking on

    If (event.shift) event.target.value = "Off";

    The user will know that it is available. You can also configure a button that resets the value of the button to "Off".

    Another option is to add another choice, as "not applicable".

  • 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;

  • change the size of the option button

    How to change the size of the option button?
    Thank you!

    I hope that there is no option to change the size of the radio button. If you want to change it, you can use the images and apply CSS

    RadioButton {}
    Width: 40;
    height: 40;
    fontSize: 18;
    fontFamily: myMyriad;
    color: #FFFFFF;
    textRollOverColor: #FFFFFF;
    ("selectedUpIcon: Embed("/images/radio_on.png ");
    ("selectedOverIcon: Embed("/images/radio_on.png ");
    ("selectedDownIcon: Embed("/images/radio_off.png ");
    ("upIcon: Embed("/images/radio_off.png ");
    ("overIcon: Embed("/images/radio_off.png ");
    ("downIcon: Embed("/images/radio_on.png ");
    }

    Thank you
    Surendra.

  • Can't seem to load correct calculation on the option button

    Hi all

    Its a long time since I cut all code and need help with this question that I hope will help me other fields I'm calculating.

    So I use Acrobat X Pro, I'm new on so I have two radio buttons with the same name auth, but the choice of Yes and no; the Yes option button is the default.

    I have a read only area I want to maintain the value based on simple logic, if yes is clicked, then set a value of 350 set the value to 0

    I walked into the Javascript code within the custom calculation script

    var Field1 = this.getField("auth").value;

    If (field1 = "Yes") {event.value = "350";

    } else event.value = "0";

    When I test this the calculated field is STILL 350 regardless of the selected option button...

    someone tell me why? or especially how to fix it.

    Thank you

    George

    You have made the classic mistake of using the assignment operator 'is', where

    You should use the 'is' operator comparison in the if statement.

  • Pulling data from a selection of the option button to use in the field

    I have a radio with 9 options button (1 000, 2 000, 3 000... 9 000). It's a form of insurance, and I can't change to a drop down or fill-in, etc..  I need a later field in the form to the number they chose in the option box.  For example, if some select 3rd in the series of radio (3,000) button I want Field2 fill-in auto number 3 000.

    Is it possible to do an if / then statement to extract data from the radio button option?  I could do this in Excel but don't have a clue how to do here.  And I don't know about Java.  :-(

    Any help would be appreciated!

    Carol

    You can try this custom script that another user here suggested to me

    You click on properties > Calculate > custom calculation Script > change

    Then paste this in...

    var v = this.getField("Name_of_Radio_button_grouping").value;

    If (v == "1000") event.value = "1000";

    else if (v == "2000") event.value = "2000";

    else if (v == "3000") event.value = "3000";

    else if (v == "4000") event.value = "4000";

    else if (v == "5000") event.value = "5000";

    else if (v == "6000") event.value = "6000";

    else if (v == "7000") event.value = "7000".

    else if (v == "8000") event.value = "8000".

    else if (v == "9000") event.value = "9000".

    etc.

    else event.value = "";

  • 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;

    }

    })();

  • Script to automatically calculate answers to the questions of the option button?

    Hello

    Anyone know if its possible / how to write a script to automatically count the responses of the radio buttons?

    For example, I have a form with 14questions, where the answers are either "Yes" 'Unknown' and 'No' - I used for each question radio buttons.

    At the bottom of the form, I want it to be automatically calculate how much 'yes' 'unknown' and 'No' responses there. (ie. a text box that displays the number of 'Yes', another area of text that displays the number of 'No'... etc)

    Can someone help me with this?

    Thank you so much

    OK, for the text field that counts the groups of numbers with the Yes option radio button is selected, you can use code like:

    // Custom Calculate script for text field
    (function () {
    
        // Initialize counter
        var sum = 0;
    
        // Loop through the fields
        // and increment the counter for each Yes value
        for (var i = 1; i < 15; i += 1) {
            if (getField("Question " + i).value === "Yes") {
                sum += 1;
            }
        }
    
        // Set the value of this field to the sum
        event.value = sum;
    
    })();
    

    Do the same for other areas, but change the 'yes' in the code above to the appropriate string, either 'No' or 'Unknown'.

    It would make sense to convert this to a function in a script at the level of the document, something like:

    // Document-level function
    var radioButtonValueCount = function (sVal) {
    
        // Initialize counter
        var sum = 0;
    
        // Loop through the fields
        // and increment the counter for each sVal value
        for (var i = 1; i < 15; i += 1) {
            if (getField("Question " + i).value === sVal) {
                sum += 1;
            }
        }
    
        // Set the value of the field that called this function to the sum
        event.value = sum;
    
    }
    

    You would then call it like that in the case of calculating a text field that counts the number of selections of Yes:

    // Set this field to the number of Yes selections
    radioButtonValueCount("Yes");
    

    Do the same for Dummies and unknown fields.

  • cfdiv refreshes liaison to the option buttons

    Hello

    Simple enough question that I can't find much information on Google (one report of it on a work around for a cfgrid controls and not a cfdiv).

    I have a cfdiv, which is tied to a cfselect and two boxes of ala:

    < cfdiv bind = "url: annex - snippet.cfm?" ' selectAll = {selectAll} & orderBy = {orderBy} & startDate = {startDa you} "id ="plan">

    selectAll and orderBy are two option buttons, which each has two States. startDate is a cfselect.

    The problem is that the cfdiv don't not auto-refresh based on any button of the radio I go second - for example, in the above example, it will refresh the option selectAll button-based, but not the orderBy option button. If I link it in this way:

    < cfdiv bind = "url: annex - snippet.cfm?" ' orderBy = {orderBy} & selectAll {selectAll} = & startDate = {startDa you} "id ="plan">

    Then, it will refresh of orderBy, but not the selectAll.

    Even more interesting is that, if I put the cfselect (startDate) AFTER the second box option in link it the list (see above) then it will not update from this, either. Just sort of "stop" refreshing once you put in a button value. radio with what whatever after this value in the list.

    Any ideas?

    Thank you
    Sam

    Here's the js function which may help you:

    assuming that your cfdiv now looks like this:

    <>
    bind = "url: annex - snippet.cfm?" startDate
    {startDate} = & selectAll {selectAll} = & orderBy = {orderBy}"id ="plan">

    Add this to each option button in the Group orderBy:

    onClick = "refreshDiv (this.value); »

    and add this js function to the HEAD of your page:

    [script]
    refreshDiv = {function (orderby)}
    StartDate = return var [0].startDate.value;
    var selectallgroup = return [0] .selectAll;
    for (var j = 0; j)<=selectallgroup.length; j++)="">
    If (selectallgroup [j] .checked) {}
    SelectAll var is selectallgroup [j] .value;.
    }
    }
    ColdFusion.navigate (' Annex - snippet.cfm? ") startDate
    = "+ startdate + & selectAll =" + selectall + & orderBy ='+ orderby "plan");
    }
    / [script]

    (Note: the function assumes that an option button in the selectAll group)
    is always verified)

    HTH

    Azadi Saryev
    SABAI - Dee.com
    http://www.SABAI-Dee.com/

  • Thunderbird COMPLAINT: Using [back |] Forward] buttons, loses "Privacy, Options button. Exit/Startup [restart] Thunderbird needed to restore the Options button.

    Thunderbird 31.7.0 (and before) COMPLAINT: using [back |] Forward] buttons, loses "In order to protect your privacy, Thunderbird has blocked a remote content in this message." Options button. Exit/Startup [restart] Thunderbird is require to retrieve the button 'Options '. Is there another way, without rebooting? [There is no help / Feedback in Thunderbird button... so I'm reporting it via Firefox.]

    Check if this being due to any any addon.

    Restart Thunderbird in Mode safe:
    Help > restart with disabled addons.
    Whist in safe mode, run for a while to see if that happens.

    If it does not work then one of your addons can cause a conflict.
    Disable each in turn to test.
    She might need to update.

  • Could you please split the 'Options' button in two?

    Used to have a single button at the top of the e-mail message to show the remote content - of Thunderbird, but now there is an Options button with this choice as well as four more. Because so many messages force me to show the remote content, need me two clicks to continue with the message. Quite boring. If this button should be divided into a button 'Show remote content' and a button 'Other Options', things would return to the previous level of convenience. (I know I might opt for remote content automatically, but I like that another security measure). TIA!

    I agree with you.
    This has been reported as a bug.

    You can add your vote for this change.
    You vote by clicking on the link to Vote - at the top where it says:
    Importance:-normal with 4 votes (vote)
    You will need to register and sign in to vote.

  • Prefill a text box from a selection of the option button

    Hi people,

    I just noticed an error in one of my first attempts at Javascript - luckily I don't think that one of my colleagues have noticed yet, but I need to fix it as soon as possible!

    I have two radio buttons naned "Radio Button13". One is for when the person is full time and one for when they are part-time. When the full time button is selected, I get text (that I placed in the value of the button) to fill out in advance a text box below. The text is something like "38 hours per week. Part-time has nothing.

    In the Mouse Up script for full-time, I placed:

    If (this.getField("Yes").value is "1")

    = this.getField("Working_Hours").value ' 08:30 to 17:00 Monday to Friday " < < < this text is same not the same as the value of the button so I don't know why I put that here, this is not what I want in the text box.

    The text of the button value is reflected in the area of text (called "working time") very well, but the idea is that when part-time work is selected, the user is able to enter the hours in the area. You can type, but as soon as you leave the text box, the text disappears.

    Where am I wrong? How can I solve this problem?

    It is not wrong, but it answers my question. If you keep things put in place what they are now, you can use the following custom calculate script:

    (function () {}

    Get a reference to the Group of radio buttons

    and its value

    var f = getField ("Radio Button13");

    v var = f.valueAsString;

    Allow the user to enter text

    Event.Target.ReadOnly = false;

    Located only value in this field if a change in the option box

    is what triggered this script

    If (event.source & event.source = f) {}

    Si (v ! == « Off » && v ! == "«) {}

    Event.Target.ReadOnly = true;

    Event.Value = v;

    } else {}

    Event.Value = "";

    }

    }

    })();

  • Change the option button in the group by programming?

    Gidday

    Is it possible to create an option button in a group programmatically?

    See you soon

    Take a look at the help documentation.  RadioButton properties includes a property group.  There is an example in this article that should help you.

    http://help.Adobe.com/en_US/FlashPlatform/reference/ActionScript/3/FL/controls/RadioButton .html? filter_flash = cs6 & filter_flashplayer = 10.3 & filter_air = 2.6 #group

  • Display the option button if the number of rows in the table is equal to 1

    I'm having issues there buy maybe a simple script out there.

    I have a table which can have up to four lines. If the table contains only one row, an option button can be clicked to change the format/entry of cells in this row. I have to hide this box of a user option, if they added more of a line to the table and make it available again if they reduce the number of lines to one.

    I have everything else works well (radio buttons change line format, add/delete rows in the table using buttons, number of rows in the first column)

    Anyone have any ideas?

    See you soon

    Bobby

    You can place it in the code that adds more lines when running... If you have questions send the fomr to [email protected] so I can check it out...

    Thank you

    Srini

  • Conditionaly without refresh report view, when I select the option button

    Hello

    I have 5 option in an option button. I created 5 parts of report.
    I want to display region report, when I select any radio button then corressponding region report should be display. This shoude be without page refreshes.


    How can I do this...


    Thank you
    Ed

    Published by: Ed on November 3, 2010 06:16

    Kaushik, can you check one of the attributes of the region report ( region of change-> attributes-> region ID static ). It wouldn't hurt to go through the documentation before asking a question, especially when someone (Jari) had bothered you post the direct link for the answer.

    Another thing, have you even read the steps I posted earlier (on the changes that I made this page in your workspace), why don't you try the same in the apex 3.2 and see if it works? After all, you can see all the code that is there since its your workspace.

Maybe you are looking for