How can I make multiple text box fields visible based on a List Box's multiple selections?
Copy link to clipboard
Copied
The code found here: https://answers.acrobatusers.com/How-can-I-make-a-field-visible-based-on-a-selection-in-combo-box-q1...
Is almost what I need, but unfortunately it only allows one text box field to be visible at one time. I would like the user to select multiple selections and have those selections appear. I currently have para1, para 2, and para3 text boxes defaulted to hidden. I have the below code in my List Box. Issue is that it only works to display 1 selection at a time. I want the user to be able to select several and then have the selected text box appear. I have attached my test document. Any help/feedback much appreciated. Thank you.
this.getField("para1").display = event.value=="para1" ? display.visible : display.hidden;
this.getField("para2").display = event.value=="para2" ? display.visible : display.hidden;
this.getField("para3").display = event.value=="para3" ? display.visible : display.hidden;
Copy link to clipboard
Copied
For a multi-select list box, the list of selected itemes is accessible through the
field.currentValueIndices property.
Here's the reference entry. there's an example of how to use it.
You'll find another example file that uses multiple selection here:
(it's on the last page of the "Dynamically Modify Email Submit Address" example)
https://www.pdfscripting.com/public/Free-Sample-PDF-Files-with-scripts.cfm
Use the Acrobat JavaScript Reference early and often

