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

Dynamicly load info for use by combo box script

Community Beginner ,
Aug 25, 2023 Aug 25, 2023

I have created a fillable order form for a girls club. The 5 levels range from a 2 to 4 year rotation. The levels also range from 5 to 9 units taught each year. To make ordering easier I have combo boxes set up to copy a description and item number to certain lines for each club. This works fine for me, but I would like to set this up so other churches could use it. Since they may choose a different combination of units each year than my choices I need to set it up so they can enter their choices. The Options tab stays the same each year (the one in the pic is for a 2 year 9 unit level, for other levels there is a 3rd or 4th year in the Options tab); Custom makes no changes to the fields and Clear removes info the fields (these need no change). The script for what is copied for each year is what needs changing. Here is a sample of my script:

 

var i = this.getField("cBxawPr").currentValueIndices;
if(i == 0) { //nothing in the fields are changed if this option is selected
}
else if(i == 1) {
    this.getField("desc119").value = "P bg Church"; //u1
    this.getField("cat119").value = "150908";
    // for this level there are 7 more units, for this question I'm listing the code for only 2 of them
    this.getField("desc127").value = "P bg Helpers"; //u9
    this.getField("cat127").value = "157870";
}
else if(i == 2) { //similar code to if(i == 1) but with different unit names & item #'s; other levels have 1 or 2 more sections like this
}
else if(i == 3) { //code to clear field contents is here; for some levels it would be i == 4 or i == 5
}

I know I could set up fields for them to enter their choices, however, including award and activity pages this involves 364 fields. Since I reset each combo box to 0 at the end, if the script for each box could load that choice from another file I could reduce it to 27 fields (or variables) that are reused in each combo box (i.e. a choice is made, the info is loaded into the fields/variables, it is then put into the appropriate order form fields freeing those fields for other boxes. Is this possible and what is the best way to handle it? (Note: I use PDFill to edit my PDF files)adobe questions1.jpg

TOPICS
PDF forms
114
Translate
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
no replies

Have something to add?

Join the conversation