• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Script help - Auto fill combo box from another combo box

Community Beginner ,
Aug 17, 2017 Aug 17, 2017

Copy link to clipboard

Copied

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)

     aItemList.push(cName);

  var prevVal = oListFld.value;

  oListFld.setItems(aItemList);

    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;

TOPICS
Acrobat SDK and JavaScript

Views

610

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Aug 17, 2017 Aug 17, 2017

Hello Jennifer,

   I posted the fix for your code in the other thread.

Votes

Translate

Translate
Community Expert ,
Aug 17, 2017 Aug 17, 2017

Copy link to clipboard

Copied

Where did you read the instructions?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 17, 2017 Aug 17, 2017

Copy link to clipboard

Copied

pdfscripting.com  is were i was following instructions from - Run by Thom Parker. I have sent a email to him as well, but not sure when he will reply.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 17, 2017 Aug 17, 2017

Copy link to clipboard

Copied

LATEST

Hello Jennifer,

   I posted the fix for your code in the other thread.

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines