Sum Fields Based on Dropdown Selection

I have (1) dropdown field named (CAT) that contains (7) items and repeats in (31) rows.  I also have (3) different decimal fields (REG, TIMEHALF, and DBL) which may or may not contain data, that also repeat in the same (31) rows.  Lastly, I have a separate field (BASEBLDGTL) that is not connected to the table, which I want to use to calculate the (3) different decimal fields base on the selection of the dropdown field.  So basically, I'm looking for the BASEBLDGTL field to add all of the REG, TIMEHALF, and DBL fields together for each row if the first item in the dropdown field is selected.  I also want the BASEBLDGTL field to be able to pickup on possible changes to the selection of the CAT dropdown field.  Any help would be gracefully appreciated as I'm a complete idiot in Java and FormCalc.

I'll give this a shot, but I'm not entirely sure what you're asking.
var amounts = xfa.resolveNodes("tblParts.Row1[*]");
var total = 0;
for (var i=0; i<amounts.length; i++) if (amounts.item(i).ddSomething == "abc") total += amounts.item(i).ExpenseAmount;
//go through the table, if the drop down matches what you're looking for, add that amount to the total
nfExpenseABCTotal.rawValue = total;

Similar Messages

  • Auto populate fields based on dropdown selection

    New to forms and needing some insight
    Is there a way to auto populate a series of fields based on the selection of a dropdown box
    for instance;
    chosing a customer's name from a dropdown box would auto populate the address, city,state zip etc...

    Yes, but not easy and you do not want to have a large number of items.
    Programming List and Combo fields in Acrobat and LiveCycle forms - Part 1 by Thom Parker

  • Dynamically enable a field based on a selected table row

    Hi everyone.
    I'm getting really confused right now, please show me the right way. My approach may be, and probably is, wrong since I am self learning this and all I have is an ASP.NET background.
    I have a page with a table in it. I've created a DataControl for a collection I've made and mapped it to the table. I added a column that shows an "edit" button. On it's click, I open a popup that shows the selected row's data. Naviguation controls are also present on the popup.
    This is working fine.
    My problem comes in the popup. Each row has multiples fields. These fields, shown on the popup, need to dynamically be enable/disable. To toggle those field, the only way I can see right now is to have a function that takes into parameter the rowId and the fieldName. Based on those two fields, I can get the necessary information to know if I need to enable or disable the control.
    What I was aiming for, but then again I totally failed, was to have that function called on the "enabled" EL Expression, returning a Boolean.
    Now that this has been said, can someone guide my on how to dynamically enable/disable each field based on the selected row.
    Thanks !

    Above +
    why don't you create a bean method that returns a Boolean ans through EL Expression Builder select the method to this property.
    btw .. on which components are you setting this?
    Also,
    If there is business logic that prohibits to update this object unless that is met.. you can also do it as..
    In EOImpl .. override isAttributeUpdateable(int i) method eg:
    @Override
    public boolean isAttributeUpdateable(int i) {
    if(i == this.ENAME && "KING".equalsIgnoreCase(this.getEname())){
    return true;
    }else
    return super.isAttributeUpdateable(i);
    and then in UI for the component say
    ReadOnly = #{bindings.Ename.updateable}
    Or, In UI
    disable = #{ bindings.Ename.attributeValue == 'KING' & bindings.Mrg.attributeValue == null ? true : false}
    adf does provides many ways to do it ..
    Cheers, Amit

  • Infopath: How to load data in one field based on value selected in another field

    We have a drop down list field in the infopath form and we have some more fields that should change depending on the dropdown selection. 
    How can we achieve this please ?
    Thank you !

    Hi Prajk, sounds like you want to do cascading dropdowns. If so, see the link below. If you're just trying to enter information into a field (not a dropdown) based off the value of the dropdown, then set a rule so that if dropdown = "this," set
    the field's value to "this."
    http://blogs.msdn.com/b/bharatgupta/archive/2013/03/07/create-cascading-dropdown-in-browser-enabled-infopath-form-using-infopath-2010.aspx
    cameron rautmann

  • Sum Fields based on change in another field

    I have data that looks like this
    <Records>
    <VBLEN>123</VBLEN>
    <MATNR>012356</MATNR>
    <ZSPR>1.02</VBLEN>
    </Records>
    <Records>
    <VBLEN>123</VBLEN>
    <MATNR>568954</MATNR>
    <ZSPR>2.05</ZSPR>
    </Records>
    <Records>
    <VBLEN>856</VBLEN>
    <MATNR>259865</MATNR>
    <ZSPR>5.98</ZSPR>
    </Records>
    <Records>
    <VBLEN>856</VBLEN>
    <MATNR>359874</MATNR>
    <ZSPR>4.12</ZPSR>
    </Records>
    <Records>
    <VBLEN>856</VBLEN>
    <MATNR>985698</MATNR>
    <ZSPR>1.06</ZSPR>
    </Records>
    In my output, I have a field on every line that is a total. So My output needs to look like this.
    <Records>
    <VBLEN>123</VBLEN>
    <MATNR>012356<MATNR>
    <ZSPR_TOTAL>3.07</ZSPR_TOTAL>
    </Records>
    <Records>
    <VBELN>123</VBLEN>
    <MATNR>568954</MATNR>
    <ZSPR_TOTAL>3.07<ZSPR_TOTAL>
    </Records>
    <Records>
    <VBLEN>856</VBLEN>
    <MATNR>259865</MATNR>
    <ZSPR_TOTAL>11.16</ZPSR_TOTAL>
    </Records>
    <VBLEN>856</VBLEN>
    <MATNR>359874</MATNR>
    <ZSPR_TOTAL>11.16</ZSPR_TOTAL>
    </Records>
    <Records>
    <VBLEN>856</VBLEN>
    <MATNR985698</MATNR>
    <ZSPR_TOTAL>11.16</ZSPR_TOTAL>
    So I need the sum of ZSPR on each line, but it has to be the sum of ZSPR for each instance of VBLEN.

    Hi Dave,
    If you are using below graphical mapping logic , you have to apply some logic (shown below ) for remaining fields of output.
    For getting Total sum  value based on VBLEN :
    For arranging remaining fields of output xml :
    Note : ZSPR_TOTAL is mentioned as Total.
    Thanks
    Hari.

  • Interactive form that auto selects input fields based on initial selection

    i want to create a form that based on initial selections, automatically highlights "required" input fields.
    i.e.  if i create an item on the form called "promotion", when this item is "checked", all the fields that are required will automatically light up, and the person completing the form cannot exit, save, and submit the form until all related fields are filled in.
    is this possible using adobe products?  i have cs5 (with dreamweaver, indesign, etc.)
    can anyone point me toward any documentation that will show me how to do this?

    This forum is for Adobe FormsCentral (formscentral.adobe.com) which is a service that allows you to create, collect and analyze data using an online web form. You should ask general HTML form related questions in the Dreamweaver forums:http://forums.adobe.com/community/dreamweaver/dreamweaver_general
    I'll move your post to that forum so you don't need to retype it. They can help you out...
    Randy

  • Showing/Hiding certain fields based on Radioset selection

    Hello all,
    I'm like to know whether it is possible to Show/Hide certain fields using a RadioSet selection as it is done in Forms in ADF UIX. Kindly go through this post.
    Showing/Hiding certain fields based on Radio Group selection
    kindly help me out on this.
    Thanks & Regards,
    Arun.V

    Hi Arun,
    Here is what I do with my checkboxes, but I think that the radiobutton will do the same:
    <af:selectBooleanCheckbox text="selectBooleanCheckbox 1"
                          label="Label 1"
                          binding="#{backing_page1.selectBooleanCheckbox1}"
                          id="selectBooleanCheckbox1"
                          autoSubmit="true"
                          immediate="true"/>
    <af:inputText label="Label 1" binding="#{backing_page1.inputText1}"
                          id="inputText1"
                          disabled="#{!backing_page1.selectBooleanCheckbox1.selected}"
                          partialTriggers="selectBooleanCheckbox1"
                          value="#{backing_page1.selectBooleanCheckbox1.selected}"/>

  • Show/Hide Fields Based on Dropdown

    Hi,
    I am attempting to show/hide subforms with a dropdown selection. I've found a lot of information on the subject, and have ended up with this as my script:
    form1.Page1.Division::exit - (JavaScript, client)
    switch (Page1.Division.rawValue)
       case "1":
       SubformZZI.presence = "visible";
       SubformZZR.presence = "hidden";  
          break;
       case "2":
       SubformZZI.presence = "hidden";
       SubformZZR.presence = "visible";      
          break;
    However, it is not doing anything when a selection is made in the dropdown box. I have the "SubformZZI" initially set as "Visible" and the "SubformZZR" initially set as "Hidden".
    Any suggestions?
    Regards,
    ZeroZone

    You have wrongly referenced the fields in your code.
    Copy and paste the below code in the click event of the Submit button. It should work as expected.
    The code thathas error is commented..
    // First check if there are null values, then construct email using script
    var vEmail = "";
    var vSubject = "";
    var vBody = "Attached to this email is a Field Service Issue - Parts Order Form for Job #" + Page1.JobNumber.rawValue + ".";
    var vName = "";
    var vCC =  "[email protected]" + "," + Page1.RSM.rawValue + "," + Page1.IssueLeaderEmail.rawValue; 
    var vFormat = "PDF";
    var errorMessage = "At least one required field was empty. Please fill in the required fields (highlighted) before continuing.";
    // Check required fields and build error message
    if (Page1.IssueLeaderEmail.rawValue == null)
    errorMessage = errorMessage;
    else
    vSubject = "Field Service Issue - Parts Order Form for Job #" + Page1.JobNumber.rawValue;
    // Check Division field
    if (Page1.Division.rawValue == "Case Division")
         //vEmail = Page1.SendFormToZZI.rawValue;
         vEmail = Page1.SubformZZI.SendFormToZZI.rawValue;
         //vCC = Page1.SendCopyToZZI.rawValue + "," + Page1.CSTZZI.rawValue;
         vCC = Page1.SubformZZI.SendCopyToZZI.rawValue + "," + Page1.SubformZZI.CSTZZI.rawValue;
    else
         //vEmail = Page1.SendFormToZZR.rawValue;
         vEmail = Page1.SubformZZR.SendFormToZZR.rawValue;
         //vCC = Page1.SendCopyToZZR.rawValue + "," + Page1.CSTZZR.rawValue;
         vCC = Page1.SubformZZR.SendCopyToZZR.rawValue + "," + Page1.SubformZZR.CSTZZR.rawValue;
    // If fields required for script are null, warn user and do not initiate email
    if (Page1.IssueLeaderEmail.rawValue == null)
    xfa.host.messageBox(errorMessage, "Sending an email", 0, 0); // Send out a custom error message if any of these fields are null
    else
    // Everything is OK, send email
    event.target.submitForm({cURL:"mailto: "+ vEmail +"?subject=" + vSubject +"&body=" + vBody + "&cc=" + vCC,cSubmitAs:"PDF",cCharset:"utf-8"});
    Thanks
    Srini

  • Check box based on dropdown selection

    I have a dropdown menu with three choices: Level I, Level II and Level III. If the user selects "Level I" from the menu, I need a checkbox named levelI to be checked. If they select "Level II", I need the checkbox named levelII to be checked, and so on.
    I don't care if the boxes are checkboxes or radiobuttons. I don't know if the code needs to go in the dropdown menu field or in the checkbox/radio button fields. If you can help, please be sure to specify whether this would be entered on a change event, or exit event, etc. because I am clueless about this one!
    I've tried all of the code combinations I can come up with based on my limited Javascript knowledge but nothing is working and I can't find any examples of this online...

    First make sure the Object > Binding tab of the dropdown you tick 'specify item values'. Then in the exit event of the dropdown menu put (in formcalc):
    if ($ == 1) then
    levelI = 1
    levelII = 0
    levelIII = 0
    elseif ($ == 2) then
    levelII = 1
    levelI = 0
    levelIII = 0
    elseif ($ == 3) then
    levelIII = 1
    levelI = 0
    levelII = 0
    endif

  • In a document library, offering only certain options for fields based on others selected

    Hi, I have a document library, and when someone uploads an item to that library, they are presented with a form to select properties. I have 4 properties I want them to select (really 6, but the first two are Name and Title). The issue is that these 4 properties
    depend on each other in this way:
    1st property: I use a lookup to offer 4 choices, "A" "B" "C" or "D" in a dropdown.
    2nd property: I want to offer the user a choice of 4 items in a dropdown, based on what they chose for the 1st property. (if they chose "A", then offer "1" "2" "3" or "4", if they chose
    "B" offer "5" "6" "7" or "8", etc.)
    3rd property: same thing as above, but now based on what they chose for the 2nd property (if they chose "1", offer "a" "b" "c" or "d", if "5" offer "s" and "t")
    4th property: again based on 3rd property.
    How can I do this? can I write some sort of custom form that can do this?

    What you're trying to do is commonly refererd to as 'Cascading Drop Downs'. These are a common lack in SharePoint.
    There are lots of ways to do that, my favourite to use jQuery or Javascript:
    http://www.sharepointboris.net/js/spcd/

  • To get the value in a field based on lov selection of another field.......

    Hi all,
    I have a requirement where
    i need to select a LOV value
    and based on that value the field next to it should be generated......
    in brief suppose i have a field name EMPLOYEE NO as lov........
    as i select the employee number the field next to it assume EMPLOYEE NAME should be retrieved based on the employee number selected..
    hope i am clear
    waiting for ur responce.....
    DEV......

    Hi,
    Assuming you are having two fields on the page. One LOV for empID (ID: empIDV) and messageTextInput for emp Name (ID: empNameV)
    1) Create a VO for your LOV having a query like SELECT emp_num, emp_name FROM employees;
    2) Create region for LOV using table using wizard based on the VO created above (choose emp_num as messageStyledText and emp_name as formValue). Also make search allowed true for emp_num.
    3) Create a LOV map1:
    LOV region item: empId
    Return item: empIDV
    Criteria item: empIDV
    4) Create lovMap2:
    LOV region item: empName
    Return item: empNameV
    Also try to implement dependent LOVs : http://sushantsharmaa.blogspot.in/2012/12/10-dependent-lov-in-oaf.html
    --Sushant                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Hide/Show Pages Based On Dropdown Selection

    Hello,
    This one is driving me crazy. In this form (attached) I have 3 checkboxes and based on what is checked, I want to hide the first page and navigate to the 1st checked box. It works for the Web Chat option, but all others do not. Also, on the next button from the Web Chat page, when I click next, I have an alert pop that should only show if Web Chat is the only selection chosen, but it shows no matter how many selections are made from the checkboxes.
    As always, any help is appreciated!

    Hello,
    That took care of the popup issue, but the navigation is still a problem. For some reason choosing any option from the checkboxes and any option from the Type of setup dropdown always brings me to either a blank page or the Web Chat page.
    Thanks for looking into this, hopefully you (or another member) can assist with this issue as well.

  • How to script text field based on checkbox selection

    I've written a script to format specific text boxes based on what checkbox is chosen. However, I'm not sure what I need to script in order to CLEAR the text field once the checkbox is unchecked. As it stands now if the checkbox is selected it formats the text field with the necessary information, but if it's unchecked the information stays in the box. I'd like to be something like 'if all boxes are Off then display 0.00.' I've included the current script for reference
    var one = this.getField("Emp 500");
    var two = this.getField ("Emp+C500");
    var three = this.getField("Emp+S500");
    var four = this.getField("Fam500");
    var five = this.getField("NC500");
    var six = this.getField("Medical");
    if (one.value == 'Yes') {six.value='70.70'}        
    else if (two.value ==
    'Yes') {six.value='127.20'}
    else if (three.value == 'Yes') {six.value='141.32'}
    else if (four.value == 'Yes') {six.value='198.00'}
    else if (five.value == 'Yes') {six.value='0'}
    var one = this.getField("Emp 1500");
    var two = this.getField ("Emp+C1500");
    var three = this.getField("Emp+S1500");
    var four = this.getField("Fam1500");
    var five = this.getField("NC1500");
    var six = this.getField("Medical");
    if (one.value == 'Yes') {six.value='61.47'}
    else if (two.value == 'Yes') {six.value='110.49'}
    else if (three.value == 'Yes') {six.value='141.32'}
    else if (four.value == 'Yes') {six.value='123.04'}
    else if (five.value == 'Yes') {six.value='0.00'}

    Hi Gayathri,
    Gayathri Venugopal wrote:
    Hi,
    I have two text items. Need to create dynamic action for the following,
    1. Order_type - Drop down values having CONSUMER & WHOLESALE.
    2. Order_number- Text field
    Order number should be disabled and only on selection of order type ,order number should be enabled.
    Can someone please help me on this?
    Create two dynamic action
    1. Make it order number item disable on page load.
       Event : Page Load
       Action : Disable
       Fire When event result is : True
       Selection Type : Item
       Item : Your order number item
    2 . enable and disable order number on selection of order type(assuming when order type is null it is disable otherwise it is enable)
        Event : Change
        Selection type : item
        Item : your order type item
        condition : is not null
    True Action
        Action : Enable
        Fire When event result is : True
        Fire on page load : True
        Selection Type : Item
        Item : Your order number item
    False Action
        Action : Disable
        Fire When event result is : False
        Fire on page load : True
        Selection Type : Item
        Item : Your order number item
    Hope this helps you,
    Regards,
    Jitendra

  • Show or hide form fields based on cfselect selection

    Hi,
    I'm using ColdFusion 9 and
    I want to show/hide a form field type=checkbox if an assigned value is selected in a dropdown list, but it doesn't work.
    I use a javascript function.
    My question is: Are there better possibilities with ColdFusion to do this or is Javascript the best solution???
    Here is my code:
    <script type="text/javascript">
        function show(){
            var select = document.getElementById('dropdownlist').selectedIndex;      
            if(select == 1) document.getElementById('area').style.display = "block";
            else document.getElementById('area').style.display = "none";       
    </script>
    <cfquery name="select_list">
    select * from table
    </cfquery>
    <cfform name ="form">
    <cfselect name="dropdownlist" onChange="show();">
        <option value="0">please select</option>
        <cfloop query="select_select_list">
         <option value="#select_select_list.id#">#select_list.name#</option>
        </cfloop>       
        </cfselect>
    <div id="area" style="display:none">
             <cfloop query="select_list" > 
             <tr style="display:none">
          <td>    
               <cfinput name="gsu"  type="checkbox"  value="#select_list.id#"> #select_list.name#
              </td>
         </tr>
             </cfloop> 
         </div>
    </cfform>
    Thank you and best regards!
    Claudia

    Okay, thank you for your answer.
    I changed the javascript function and replaced the <div> with the <table> tag. Then it works.
    Here is an extract of my code:
    <script type="text/javascript">
        function show(){
            var select = document.getElementById('dropdownlist'); 
            var strUser = select.options[select.selectedIndex].value;    
            if(strUser== 1) document.getElementById('area').style.display = "block";
            else document.getElementById('area').style.display = "none";       
    </script>
    <cfquery name="select_list">
    select * from table
    </cfquery>
    <cfform name ="form">
    <table id="area" style="display:none">
             <cfloop query="select_list" > 
             <tr">
          <td>    
               <cfinput name="gsu"  type="checkbox"  value="#select_list.id#"> #select_list.name#
              </td>
         </tr>
             </cfloop> 
         </table>
    </cfform>

  • Auto-populating text fields based on dropdown option

    This has probably been covered on this forum before.  I would like to auto-populate multiple text fields with pre-programmed data based on a user-selected option from a drop-down list.  The file here should explain clearly what I want to do:
    https://acrobat.com/#d=ID7ezZN5ZzIKgVvmgkyMiw
    Where can I find an example code that would accomplish this task?  Thanks.
    -Paul

    Your form data hierarchy is different than mine. You need the brackets also, otherwisethe first assignment statements executes only.
    // form1.#subform[0].DropDownList1::exit - (JavaScript, client)
    if (!(this.isNull)) {
      var char = this.rawValue;
      TextField41.rawValue = "Data " + char + "1";
      TextField42.rawValue = "Data " + char + "2";
      TextField43.rawValue = "Data " + char + "3";
    Steve

Maybe you are looking for

  • Find the user exit while creation and change of sales order

    Hi Team Below mentioned requirement , in which user exit i have to put below logic while creaion and change of sales order? u2022     The logic for the user exit to explode should consider the following assumptions and validations o     Customer mast

  • How to limit the number of items from RSS using XSLT

    Hello, I am using plsql to read contents from RSS, basically a simple RSS reader. I would like to somehow want the feature to restrict the number of items in the RSS feed, say I would like to display only the first 5 items. How could I achieve this?

  • How is YTD calculated in bex ?

    we have a requirement to calculate YTD for revenue in a report. Just want to understand if YTD is always the current year restricted to KF or we need to consider the value from the user like 0fiscper and adjust YTD, as per the user input. I mean for

  • Crystal Reports 2008 Pie Chart Data Labels

    Hi, I've been trying to figure out why I cannot get the option to put pie chart data labels in the center of each slice.  There's an option to place them there, but everytime I select it, the graph reverts to putting the data labels on the outside wi

  • Get credit for song purchased twice

    How can I get credit for same song purchased twice?