3 Replies Latest reply on Aug 17, 2017 10:48 AM by Thom Parker

    Script help - Auto fill combo box from another combo box

    jenniferc11972072 Level 1

      I have been trying to follow instructions on how to create combo which auto pop another combo and intern that combo box auto pop other cells.  I used an existing sample script and tried to replace there var and objects with mine but it not functioning. Can someone review my script?


      I have 6 cells goals, tactics, results, budget, action, tips. Both goals and tactics are combo boxes/drop boxes and the remain four are auto pop from the tact selection.


      Please note i am very new to coding and trying my very best.




      var oTactRef = {

          "Everyday client meetings":{result:"5 referrals", budget:0, action:"Make asking for Introductions a regular part of the client meeting.", tips:"Use these meetings to initiate your new Value Discussion initiative"},

          "Phoenix Conversations": {results:"10 refferrals", budget:100, action:"Reignite your current client base by booking meetings to discuss your new brand in-depth", tips:"Let them know that their experience is valuable and that you always welcome their feedback on how you can improve"} ,

          "Client Survey Results":{results:"8 referrals", budget:150, action:"Set up reminders to regularly send clients the survey 30 to 60 days before a meeting or anniversary.", tips:"Do NOT mention to your client that you reviewed their client survey responses. They are meant to be anonymous."},


      var oTactDigt ={

          "Sourcing through LinkedIn":{results:"25 followers", budget:0, action:"Search for and add 10-15 clients from your list on LiknkedIn per day.",tips:"Always be prepared withw soft opening"},

          "feacebook sponsored post":{results: "30 new followers", budget:1000, action:"Run a sponsored Facebook campaign aimed at the strategic locations you have identified", tips:"Using Facebooks bidding platform for Sponsored posts, we will work with an initial budget of $500 and focus the activity around certain days, times and areas."},

          "Facebook activity":{results:"10 new followers", budget:0, action:"Every day visit www.igcontenthub.com and post 1 piece of content to your team page.", tips:"When choosing content to post, make sure to be as relevant to the day as possible."},






      var oGoals = {

                    //"Increase New Assets":{Tactics:oTactAss},

                    //"Increase Share of Wallet":{Tactics:oTactWal},

                    "Increase Referrals":{Tactics:oTactRef},

                    //"Increase Insurance Cases":{Tactics:oTactRef},

                    //"Increase Mortgages":{Tactics:oTactMor},

                    //"Increase Brand Awareness":{Tactics:oTactBrnd},

                    //"Increase Volunteer-ism":{Tactics:oTactVol},

                    "Increase Digital Footprint":{Tactics:oTactDigt}

                    //"Increase Campaign Use":{Tactics:oTactCamp}




      function SetListItems(oDataSelection, oListFld)


        var oListSel = oDatascource.Tactics;



        var aItemList = [" - "];

        for(var cName in oListSel)




        var prevVal = oListFld.value;




          oListFld.oDataSource = oListSel;



          oListFld.oDataSource[" - "] = {results:oDataSelection.results, budget:oDataSelection.budget, action:oDataSelection.action, tips:oDataSelection.tips,};



        oListFld.defaultValue = " - ";

        oListFld.value = bBlockValueChanges?prevVal:" - ";




      function  SetFieldValues(cSel, oDataSource, oResultFld, oBudgetFld, oAction, oTips)


         if(oDataSource && cSel && !bBlockValueChanges)


            var oItemVals = oDataSource[cSel];

            oResults.value = oItemVals?oItemVals.results:"";

            oBudget.value = oItemVals?oItemVals.budget:"";

            oAction.value = oItemVals?oItemVals.action:"";

            oTips.value = oItemVals?oItemVals.tips:"";





      var bBlockValueChanges = (this.getField("Goal_1").value != "");

      SetListItems({price:"", budget:"", Tactics: oGoals},this.getField("goal_1"));



      var bBlockValueChanges = (this.getField("Goal_2").value != "");

      SetListItems({price:"", budget:"", Tactics: oGoals},this.getField("goal_2"));



      var bBlockValueChanges = (this.getField("Goal_3").value != "");

      SetListItems({price:"", budget:"", Tactics: oGoals},this.getField("goal_3"));



      bBlockValueChanges = false;