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

ListBox to CheckBox help

Community Beginner ,
Apr 16, 2020 Apr 16, 2020

Copy link to clipboard

Copied

Hello,

 

I am hoping to get some suggestions for the following:

 

Example: I have a ListBox with multiple selections enabled. Let's say the values are ITEM1, ITEM2, ITEM3, ITEM4. Now say I have 4 CheckBoxes (Labelled: ONE, TWO, THREE, FOUR) that will be checked depending on which ListBox items are selected. So if the user selects ITEM2 and ITEM4 from the ListBox, the respective CheckBoxes TWO and FOUR will be checked.

 

Any idea on how to accomplish this? I am sorry if this is a novice question however I am not the most advanced user.

 

Thank you

Louis

TOPICS
Acrobat SDK and JavaScript

Views

61

Likes

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 ,
Apr 16, 2020 Apr 16, 2020

Copy link to clipboard

Copied

What do you know about JavaScript?  The solution you need is a bit complex, and if you don't know JS you'll never get there.  The key piece of info you need for a solution is that the indexes of the selected items are in the "currentValueIndices" property of the List Field.  You'll need to come up with a way to relate the items in the list box to the checkboxes. A good way to do this is to incorporate the values of the list items into the names of the checkboxes. 

 

I would suggest you start by reading this article:

https://acrobatusers.com/tutorials/list_and_combo_in_lc/

 

You'll find more information and tons are examples and tutorials on programming lists here (paid for site):

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

 

 

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

Likes

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 ,
Apr 17, 2020 Apr 17, 2020

Copy link to clipboard

Copied

LATEST

Thank you Thom. I have some knowledge of JS. I have been learning as I go and have quite a bit of script in my forms. I will take a look at what you sent.

 

Thanks again

Louis

Likes

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