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

change drop down choices based on radio / checkbox selection

Explorer ,
Feb 10, 2021 Feb 10, 2021

Copy link to clipboard

Copied

Hey all, I'm back again with yet another question. I've searched the forums and googled lots and have found answers for livecycle but the code wont work in Acrobat.  (this article and the attached PDF is almost exactly what I want: http://assuredynamics.com/index.php/portfolio/populating-dropdowns/ )

 

So I have "Vehicle Type" radio buttons (car, midsize, full size) that when selected show 3 checkboxes: car int, car ext, car full or mid int, mid ext, mid full, etc.

 

When "Vehicle Type - car" and then "car int" is selected I want "addon - drop" (I want this drop down hidden until the path is completed) drop down to have the options:

Package A

Package B

Package C

 

and then have the "addon total" box calculate cost (with what ever there value is)

 

And when "Vehicle Type - car" and then "car ext" is selected I want "addon on" drop down list to change to have these options:

Package D

Package E

Package F

 

and then have the "addon total" box calculate cost (with what ever there value is)

 

 

I know I can do this by making multiple drop downs with export values and then hiding and showing but I really want to cut down on the amount of fields in the document and make this as easy as possible. I know I need a javascript code and I've tried everything I can think of  (I'm a beginner) so I you could *please* provide the code and where exactly to input it that would be amazing! I provided a screen shot of the structure to make more sense 

 

Thanks!

 

 

 

 

TOPICS
Create PDFs , General troubleshooting , How to , JavaScript , PDF forms

Views

613

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 23, 2021 Feb 23, 2021

Copy link to clipboard

Copied

LATEST

First, see my answer here:

https://community.adobe.com/t5/acrobat/interactive-pdf/td-p/11806036?campid=23013&cid=101&aid=23013_...

 

The selection process you've outlined here is more complex. You've added more selectors, so the data needs to be structured to reflect the complexity of the  selections.

However, you have not fully explained the relationships. With radio buttons, only one can be selected, so it's easy to select a single list of items for the "AddOns" dropdown, but with checkboxes, any and all of them could be selected. So what happens when both the "Int" and "Ext" checkboxes are selected?

 

To select a price, you need a set of price data, similar to the list items, that can be selected or calculated based on the selectors.  As described here:

https://acrobatusers.com/tutorials/change_another_field/

 

You can read more about scripting lists here:

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

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