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

How can I make multiple text box fields visible based on a List Box's multiple selections?

New Here ,
Feb 20, 2020 Feb 20, 2020

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;

TOPICS
Acrobat SDK and JavaScript

Views

191

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 ,
Feb 20, 2020 Feb 20, 2020

Copy link to clipboard

Copied

LATEST

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. 

https://help.adobe.com/en_US/acrobat/acrobat_dc_sdk/2015/HTMLHelp/#t=Acro12_MasterBook%2FJS_API_Acro...

 

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

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