Creating calculation based on result of dropdown box

Hi there. I am hoping someone will be kind enough to help me with some Javascript as it seems I am too blonde and middle aged to figure it out by myself.
I have a dropdown box 'Member'. The value for Yes is 0. The value for No is 10.
Then I have three check boxes. 'Day1' value is 35. 'Day2' value is 25. 'Dinner' value is 65.
If Yes is selected, I want the sum of the check boxes if they are checked. (eg, total if all checked = 125)
If No is selected, I want the value of each check box increased by 10. (eg, total if all checked = 155)
I am using Acrobat X.
Thanks in advance.

Because of the fact that you want to add a constant to a number of values if a given condition is meet 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 plus adjustement
if (nDay1 != "Off") sum += Number(nDay1) + cMember;
// day 2 plus adjustement
if ( Day2 != "Off") sum += Number(nDay2) + cMember;
// dinner plus adjustement
if (nDinner != "Off") sum += Number(nDinner) + cMember;
event.value = sum;
Excel is only easy if you accept Microsoft's view of calculations.

Similar Messages

  • How can I make a subform conditional upon results of dropdown box?

    I have a dropdown box. I also have a subform. If you select "A," I want the subform to appear.  If you select "B", I don't want the subform to appear.  I am using Adobe Livecycle Designer 8.0.  Am I in the right forum?

    Hi,
    Example script is:
    On cange event of drop down
    var newtext = xfa.event.newText;
    var  value = this.boundItem(newtext);
    if (value == "A") {
         subform.presence = "visible";
    else if (value == "B"){
         subform.presence = "hidden";
    BR,
    Paul Butenko

  • Create a dynamic form where selected text boxes appears, based on options chosen in a drop-down box

    HELP!!! Can anyone please provide some guidance on how to create a dynamic form where selected text boxes appears, based on options chosen in a drop-down box.
    I have a form which – based on the department that's selected from a drop-down box – will have different form fields/text boxes, etc, made available.
    Is this possible in LiveCycle, if so, can you please provide the script/info - as needed.
    Thanks,

    In the preOpen event of the second dropdown list you put something like (in formCalc):
    if (dropdown1 == 1) then
    $.clearItems()
    $.setItems("Year, 2 Year,  3 Year")
    elseif (dropdown1 == 2) then
    $.clearItems()
    $.setItems("3 Year,  4 Year")
    endif

  • How Do i create a list that will show in a dropdown box with the list being pulled from another tab and not the cell data format junk?

    How Do i create a list that will show in a dropdown box with the list being pulled from another tab and not the cell data format junk?
    I currently run OS X 10.10.1
    Now i have been trying to work on this for a while now and what i want to do should be simple but its apparently not.
    Here is an example of what i want to happen.
    I will have 2 tabs: Contact | Sales
    Now Contacts will have the list of names and various information about a customer, While Sales will have one drop-down box for each Cell Row that will show the names of the person in tab contacts
    for what i am wanting to do i cant use the data format pop-up menu because the list is edited everyday several times a day.
    Now how do i do this, Excel can do this so how can numbers do it?

    Hi Shegra,
    Paste this into a applescript editor window and run it from there. In the script you may need to adjust the four properties to agree with your spreadsheet. Let me know if you have any questions.
    quinn
    Script starts:
    -- This script converts column A in one table into an alphabetized list of popups. It copies the last cell in that column. Then reverts the column to text. It then refreshes popups in column A of a data table starting with a user defined row.
    property DataEntrySheet : "Sheet 1" --name of sheet with popups to be refreshed
    property DataEntryTable : "Sales" --name of table with popups to be refreshed
    set copyRange to {}
    property PopValueSheet : "Sheet 1" --name of sheet with popup values table
    property PopValueTable : "Contacts" --name of table with popup values
    set PopStartRow to {}
    tell application "Numbers"
      set d to front document
      set ps to d's sheet PopValueSheet
      set pt to ps's table PopValueTable
      set s to d's sheet DataEntrySheet
      set t to s's table DataEntryTable
      set tf to t's filtered --this records filter setting on data Entry Table
      display dialog "Start from row #..." default answer "" with icon 1 -- with icon file "Path:to:my.icon.icns" --a Week # row
      set PopStartRow to {text returned of result}
      tell pt --convert list to alphabetized popups
      set ptRows to count rows
      set copyRange to ("A2:" & name of cell ptRows of column "A")
      set selection range to range copyRange
      set selection range's format to text
      sort by column 1 direction ascending
      set selection range's format to pop up menu
      -- popupsmade
      set selection range to cell ptRows of column 1 of pt
      set v to value of cell ptRows of pt
      end tell
      activate application "Numbers"
      tell application "System Events" to keystroke "c" using command down
      tell pt
      set selection range to range copyRange
      set selection range's format to text
      end tell
      tell t
      set filtered to false
      set tRows to count rows
      set pasteRange to ((name of cell PopStartRow of column "A") & ":" & (name of cell tRows of column "A"))
      set selection range to range pasteRange
      tell application "System Events" to keystroke "v" using command down
      set filtered to tf
      end tell
    end tell

  • How to populate a dropdown box based on a selection in another Dropdown box.

    I am trying to find out a way to do the following:
    I am using coldfusion ....working on a form. The form has
    couple of dropdown boxes. Based on the selection on the first
    dropdown box another dropdown box needs to get populated with
    different options. These options will be coming from a query. I am
    trying to find out the Javascript code for doing this.
    Thanks in advance.

    jchopra,
    There's a method to doing what you're wanting to do that I've
    used extensively.
    Basically, within my code, I start by invoking the method
    that returns the data for the dropdown lists. Then, I use the
    following code to pour the data returned into a javascript array:
    var locArray = new Array(#evaluate(locs.recordcount+1)#);
    locArray[0] = new Array('','','','','','','','','',);
    <cfloop query="locs">
    locArray[#locs.CurrentRow#] = new
    Array('#JSStringFormat(locationId)#',
    '#JSStringFormat(fkyPolicyId)#',
    '#JSStringFormat(locationNumber)#',
    '#JSStringFormat(description)#',
    '#JSStringFormat(address1)#',
    '#JSStringFormat(address2)#',
    '#JSStringFormat(zipcode)#',
    '#JSStringFormat(city)#',
    '#JSStringFormat(state)#';
    </cfloop>
    Then I wrote a javascript function that is assigned to the
    first dropdown's onChange() event. When the user changes the value
    that is selected within the dropdown, I use javascript to locate
    (using the policyid) the corresponding record in the javascript
    array and populate and/or select the appropriate value(s) in the
    second dropdown.
    If the data returned from the method invocation is too large
    to use within a javascript array, you may need to limit the results
    that are returned.
    Hope this makes sense. If not, please let me know.
    ds

  • Is there a way to create forms where certain fields would become required only if there was a certain choice made in a dropdown box in another field?

    Is there a way to create forms where certain fields would become required only if there was a certain choice made in a dropdown box in another field?

    Yes but you will have to create some custom JavaScript to do this.
    Also you should be aware that the "Required" property is only processed when the form is submitted to a scripted web page or "mailto:" process.

  • How to Create a DropDown Box in a Selection Screen.

    Hi,
    I have a question. i.e, How to create a dropdown box in a Selection Screen. Could you please assist me.
    Thanks & Regards
    Sathish Kumar

    hi satish,
    The following can assist u to create a drop down ....
    Drop down list box can be created in a dialog screen(SE51) as well as selection screen.
      The sap list box allows to select a value from the list but we cannot enter our own value in the list box .The value list that will be displayed consists of two
    fields TEXT field of TYPE 80(C) and internal KEY field of TYPE 40(C).
    In screen painter to create a input/output field into list box we use
    'L" as a value for dropdown attribute for the i/o field.
    In screen painter to determine the type of method that will be used to fill the value
    list we use the attribute value list.
    If it is blank  the value list will be filled by the first column of the input help assigned to the screen field.This input help can be defined in the ABAP Dictionary, on screen using SELECT,VALUES screen statements or in event POV (PROCESS ON VALUE-REQUEST ) and the input help that will be passed to the field should consists of 2 columns ,the key column is filled automatically by the system.SAP recommends value list field should be blank.
    or
    The value  can be 'A' meaning that the value list will be filled in the event PBO(PROCESS BEFORE OUTPUT) or before the screen is displayed.In this method we use function module VRM_SET_VALUES to fill the values and pass it to the i/o field.
    If a function code is attached to the list box the selection of a value triggers a PAI
    otherwise PAI will not trigger.
    Example
    Dropdown list boxes
    REPORT DEMO_DYNPRO_DROPDOWN_LISTBOX.
    TYPE-POOLS VRM.
    DATA: NAME  TYPE VRM_ID,
          LIST  TYPE VRM_VALUES,
          VALUE LIKE LINE OF LIST.
    DATA: WA_SPFLI TYPE SPFLI,
          OK_CODE LIKE SY-UCOMM,
          SAVE_OK LIKE SY-UCOMM.
    TABLES DEMOF4HELP.
    NAME = 'DEMOF4HELP-CONNID'.
    CALL SCREEN 100.
    MODULE CANCEL INPUT.
      LEAVE PROGRAM.
    ENDMODULE.
    MODULE INIT_LISTBOX OUTPUT.
      CLEAR DEMOF4HELP-CONNID.
      SELECT  CONNID CITYFROM CITYTO DEPTIME
        FROM  SPFLI
        INTO  CORRESPONDING FIELDS OF WA_SPFLI
       WHERE  CARRID = DEMOF4HELP-CARRIER2.
        VALUE-KEY  = WA_SPFLI-CONNID.
        WRITE WA_SPFLI-DEPTIME TO VALUE-TEXT
                               USING EDIT MASK '__:__:__'.
        CONCATENATE VALUE-TEXT
                    WA_SPFLI-CITYFROM
                    WA_SPFLI-CITYTO
                    INTO VALUE-TEXT SEPARATED BY SPACE.
        APPEND VALUE TO LIST.
      ENDSELECT.
      CALL FUNCTION 'VRM_SET_VALUES'
           EXPORTING
                ID              = NAME
                VALUES          = LIST.
    ENDMODULE.
    MODULE USER_COMMAND_100.
      SAVE_OK = OK_CODE.
      CLEAR OK_CODE.
      IF SAVE_OK = 'CARRIER'
         AND NOT DEMOF4HELP-CARRIER2 IS INITIAL.
        LEAVE TO SCREEN 200.
      ELSE.
        SET SCREEN 100.
      ENDIF.
    ENDMODULE.
    MODULE USER_COMMAND_200.
      SAVE_OK = OK_CODE.
      CLEAR OK_CODE.
      IF SAVE_OK = 'SELECTED'.
        MESSAGE I888(BCTRAIN) WITH TEXT-001 DEMOF4HELP-CARRIER2
                                            DEMOF4HELP-CONNID.
      ENDIF.
    ENDMODULE.
    Reward if useful.
    Thank you,
    Regards.

  • Calculation based on radio box Help PLEASE....

    I am trying to make a text box perform a calculation based on whether or not a radio button is checked or not.
    If the radio button named "Basting" in the "Quilting Type" group is checked then the text box "Basting Charge" should find the value of the "Total Square Inches" field and  multiply that total by 0.015 and show the new total in the text box as a dollar value, if the radio button "Basting" is not checked the value in the "Basting Charge" field should be "-0-".
    I can get the calculation I want from this:
    var v1 = getField("Total Square Inches").value; event.value=v1*0.015;
    but how to include the radio button function and the "-0-" ?

    Okay, I have now made a "check box" with the name of "Basting", not in a grouping.
    This is the set up:
    Text Field = Total Square Inches
    Check Box = Basting
                                       Export Value = Yes
    Text Field = Basting Charge
    Calculation for "Basting Charge" should be "0" unless the "Basting" check box is used, then it should get the value of the "Total Square Inches" and multiply that number by 0.015 and show this value in the "Basting Charge" box displaying as a dollar figure.
    So if the value in the "Total Square Inches" is 12,000
    and the "Basting" check box is used
    The "Basting Charge" should read "$180.00"
    if the check box is not used then it should read "-0-"

  • How to create dropdown box, radio button,check box in wad

    Hi,
    How to create dropdown box, radio button,check box in wad.
    Thanks,
    cheta.

    Cheta,
    This are all standard Web Items in the WAD. Drag them onto your template and then make the changes you need to them in their Properties.
    Regards
    Gill

  • Creating Cascading Filter Dropdown boxes when data source is BO (Unx) Universe.

    Currently it is understood that cascading filter dropdown boxes are possible only with HANA and BW datasources.  Is there a plan to release this functionality with Design Studio version 1.3?  Did anybody find a workaround for this yet?

    Hi Vivek,
    Please check out this post: How to Create Multiple Dropdown boxes (Cascading Filters) when using Universe in the backend.
    Regards,
    Mustafa.

  • Create Materialized View based on Results from LDAP Query

    Hi -- I'm trying to create a materialized view based on results from an LDAP query. Unfortunately, it looks like a materialized view can't be created based on a stored procedure, which is where the LDAP results are obtained (using nested loops).
    Does anyone have any idea how to do this without first kicking off a stored procedure that populates a temp table which would be used to create the materialized view? I'm trying to minimize the steps that the DBA's will need to go through when refreshing this new view.
    Thanks,
    ~Christine

    Can you give us more details about the stored procedure you're calling. It will help to know what parameters are involved and what data types they are.
    Off the top of my head though it looks like, at the very least, you would need a stored function that calls the stored procedure. I don't think there is any way to call stored procedures from CREATE ... commands. If you're going to create a stored function anyway ... well, you might as well just create a procedure that inserts values into a regular table instead of fussing with functions and materialized views. You'll probably want to schedule your new procedure to run periodically since it sounds like you'll need the values refreshed from time to time.

  • Get values based on Dropdown box selection-Important

    Hi All,
    In first table, i have an two textfields one is for "item no" and other is "item desc" and in the second table I have an "dropdown box" and "item desc".
    Whatever is entered in the "item no" its populating in the "dropdown box", when an dropdown is selected any item that item desc should be displayed.
    For example: In first table
    Item no  Item Desc
    item 1   abc
    item 2   def
    item 3   ghi
    and in the second table
    Dropdown box   Item desc
    item 2   def
    item 3   ghi
    When am selecting item2 in dropdown box the related text is not getting dispalyed. And moreover the using instindex and the value is populating 0, below is the script
    var Instindex = xfa.resolveNode("Page1.Subform1.Table1.Row2.Calculation").rawValue;
    app.alert(Instindex);
    var my_concatcomm = xfa.resolveNode("Page1.Itemtable.Table2.Row2[" + Instindex + "].EnterItemDescription").rawValue
    var my_concatcomm = "Page1.Itemtable.Table2.Row2["+ 3 +"].EnterItemDescription"
    app.alert("Index value::"+ xfa.resolveNode(my_concatcomm).rawValue);
    Can anybody please help me on this.
    Thank you for your help in advacne

    Yes one more thing, i do not want any buttons or anyother webitem to be clicked to get this. this should be set with some commands if avilalbe or some other guess ?

  • Need help in creating a dropdown box inside a table control

    Hi,
    I need to display a calender upon click event of a dropdown box placed inside my table control.
    Can any body help me out.
    Regards,
    Srinivas

    Try this ex
    TYPE-POOLS VRM.
    VALUES-KEY = 'D'.
      VALUES-TEXT = 'Double Crate'.
      APPEND VALUES.
      VALUES-KEY = 'S'.
      VALUES-TEXT = 'Single Crate'.
      APPEND VALUES.
      VALUES-KEY = 'C'.
      VALUES-TEXT = 'Carton Box'.
      APPEND VALUES.
      VALUES-KEY = 'P'.
      VALUES-TEXT = 'Pallet'.
      APPEND VALUES.
      VALUES-KEY = 'W'.
      VALUES-TEXT = 'Wood.Case'.
      APPEND VALUES.
      VALUES-KEY = 'L'.
      VALUES-TEXT = 'Loose'.
      APPEND VALUES.
      CLEAR VALUES.
      CALL FUNCTION 'VRM_SET_VALUES'
         EXPORTING
           ID                    = 'CRTYPE'
           VALUES                = VALUES[]
        EXCEPTIONS
          ID_ILLEGAL_NAME       = 1
          OTHERS                = 2
    hope it helps..
    Edited by: prabhu p on May 22, 2008 10:55 AM

  • Create a Button that Opens a Specific Web Link from a Dropdown Box

    Hi guys.  My main question is, how do I make a Button that opens a specific Web Link, depending on the URL selected in a Dropdown box?
    Example:
    I'm a comlpete newbie and need a code sample of how this would work!  Thanks!
    I have a couple other questions which are related to this. 
    1) Is it possible to hide the URL in the Dropdown list, and only show the Name, so for examlpe, it would only list Hotmail, Gmail, Yahoo, and not the www....com?
    2) Another more advanced question is, once the web link is opened, is it possible to have adobe input or fill-in the Login and Password fields into the website and then hit "Enter" for you.  The Username and Password would be stored somewhere in adobe and would depend on the weblink opened. So for example: When you open Hotmail, it would use the following; Username:[email protected] and Password:password1, but if you opened Gmail, it would use a different Username and Password stored for Gmail.
    3) Finally, out of curiousity, is it possible to have adobe extract data from a website, and fill them into an adobe form?  This maybe over my head, but any starting point or examples would be of great help!

    Use something like this as the button's MouseUp action:
    app.launchURL(this.getField("URL Dropdown").value));
    To answer your other questions:
    1) Yes. Place the URL as the export value of each option, and the name of the site as the display value. The code I provided can remain the same.
    2) No.
    3) Might be possible, but it's very tricky. The way to do it would be to convert the website to a PDF, process that PDF to extract the data from it, and then use that to populate the form fields. That would require quite advanced scripting knowledge, but it could be possible.

  • Initial value for a dropdown box

    Hello all,
    I have created a web template in the WAD (BI 70) with a dropdown box on a characteristic. A chart is displayed based on the query result. My query is built on an infoset.
    My problem is to populate the filter with an initial value and still let users change the characteristic value in the dropdown (all values for the characteristic is not acceptable in the context) . Also, I don't want the variable screen to show up.
    What is the best approach to achieve this?
    Thanks,
    JL

    In Query Designer you put in your default value in the area to the right in the first pane..
    If you put it on the left hand side, the filter will not be changeable.
    Hope this helps.
    Can give more presise answer if you need it.

Maybe you are looking for

  • 'TOTAL' text display in ALV GRID output

    Hi,   My requirement is to display 'TOTAL' text at the end of the ALV report alongwith Totals for the respective columns.   I've used Classical method(i.e. used ALV GRID FM) to display the report.   For Totals I've used 'DO_SUM', option and for text

  • How can I restore my UI to Aqua?

    HELP

  • Looking for limits and comparison on UCCE vs UCCX for 300-400 agents cc

    Hello all, I am trying to find some comparison and qualifying info for my client who currently have under 300 agents and may go to 400 agents max.  They have CUCM, IPCC 7.x and CVP all redundant etc. I need some facts and documents to support if UCCX

  • What is the point of iCloud

    Please don't get me wrong I love my iMac, iPhone, iPad but am confused by iCloud. I tried syncing/backing up to it and it quickly ran out of space and asked me to pay for more room, in itunes the option seems to be back up to computer or to icloud -

  • Adobe forms - server settings

    Hi I have installed Adobe Life Cycle Design in my system. But I dont know what are the settings to be done in the Server. Can any one help me in this regard. Regards, Rajesh Edited by: Matt on Oct 31, 2008 7:43 AM - Added more meaningful title