Skip to main content
woodleigh
Known Participant
December 11, 2017
Answered

A combination of 3 dropdown selections, equal 1 of 5 outcomes

  • December 11, 2017
  • 1 reply
  • 1431 views

Hi there


I'm not sure if I'm even asking this correct, but I have a page in an interactive document that I would like to automate a bit further than I already have.  I have 3 dropdown menus where the user selects with Low, Medium or High for each of the 3 dropdowns.  Those 3 selections then determine a possible 5 outcomes, Inform, Consult, Involve/Collaborate, Involve and Consult/Involve.

I'd like to find out, is there a way that when the user makes their 3 selections, how I can automatically populate a field with one of those 5 outcomes.

Thanks in advance, I have no javascript experience, but crossing my fingers I don't need it. 

I'm using Acrobat Pro DC 2018.009.20050, the end user could be using any recent versions of Acrobat.

Kind regards
Adam

This topic has been closed for replies.
Correct answer Thom Parker

Here are some tutorials on using Lists

https://acrobatusers.com/tutorials/change_another_field

https://www.pdfscripting.com/public/List-Field-Usage-and-Handling.cfm

https://acrobatusers.com/tutorials/list_and_combo_in_lc

The first and second ones are most relevant for your needs, and they provide all the basic info you'll need on where to put the script, but not for the solution I provided.

The solution I outlined above is for a Calculation script on the field that displays the outcome.  But you could certainly do this from a "Keystroke" script on the last dropdown list field.  That is a different, but similar, solution to using the calculation script, and it is covered in the first article linked.

Neither of these solutions uses any of the scripts on the Actions Tab.

There is a big hole in this discussion, which is how to do the 3 selection values translate into the outcome? 

You should consider hiring a professional to help you with this.

1 reply

Thom Parker
Community Expert
Community Expert
December 11, 2017

There are a couple of different options. The easy one is to use a calculation script in the field that displays the outcome.  This is not the best option because calculation scripts are called anytime any field is changed. If there are a lot of fields/calculation scripts, then this script just adds to the overall slowness of the form.  But if its a simple form, or there aren't many other calculations, then this is the easiest for a novice to implement.

something like this;

var cSel1 = this.getField("Selection1").value;

var cSel2 = this.getField("Selection2").value;

var cSel3 = this.getField("Selection3").value;

... Do calulation to find outcome

event.value = cOutcome;

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
woodleigh
woodleighAuthor
Known Participant
December 11, 2017

Thanks Thom.  I'm probably a little less than a novice Thom, I can code css, html5, but just not javascript, so the jv code is not that clear to me.

Would it be too much trouble for you to firstly, confirm that I enter this javascript directly into actions tab of the field properties box?  Second, the three selections will be a combination of Low, Medium and High, the possible outcomes depending on that combination should equal either, Inform, Consult, Involve/Collaborate, Involve or Consult/Involve.  Any chance of a real example using these variables or maybe some direction as to where in the code I input these values?  Happy to share my form page, if it makes it easier.

Thanks again.

Thom Parker
Community Expert
Thom ParkerCommunity ExpertCorrect answer
Community Expert
December 11, 2017

Here are some tutorials on using Lists

https://acrobatusers.com/tutorials/change_another_field

https://www.pdfscripting.com/public/List-Field-Usage-and-Handling.cfm

https://acrobatusers.com/tutorials/list_and_combo_in_lc

The first and second ones are most relevant for your needs, and they provide all the basic info you'll need on where to put the script, but not for the solution I provided.

The solution I outlined above is for a Calculation script on the field that displays the outcome.  But you could certainly do this from a "Keystroke" script on the last dropdown list field.  That is a different, but similar, solution to using the calculation script, and it is covered in the first article linked.

Neither of these solutions uses any of the scripts on the Actions Tab.

There is a big hole in this discussion, which is how to do the 3 selection values translate into the outcome? 

You should consider hiring a professional to help you with this.

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