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

Where do I put the document level javascript?

New Here ,
Jun 27, 2017 Jun 27, 2017

Copy link to clipboard

Copied

I am fairly new to creating forms via Acrobat. This form is a questionnaire meant to be distributed to many different clients.

I haven't had any issues creating it, and it looks fine, I'm just encountering one major issue. I'm trying to insert a dropdown (i.e. Business Unit) ... Upon choosing a business unit from the dropdown, I would like that to reveal a new dropdown with options shown based on the user's previous selection. (i.e. Business Unit 1 only shows NY, NJ & PA as the choices, whereas choosing Business Unit 2 would reveal CA, NV & AZ....etc)

I believe I have written the correct javascript to execute an action like this, however I do not think I am putting it in the right place or understand where the right place to drop this is. If someone could help walk me through this, and verify that I am headed in the right direction - any help would be MUCH appreciated!

Thank you

TOPICS
Acrobat SDK and JavaScript , Windows

Views

1.2K

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

correct answers 1 Correct answer

Community Expert , Jun 27, 2017 Jun 27, 2017

I created a sample that makes this much easier. You can just copy the drop downs out of the form and edit them to your needs. See the URL below.

http://practicalpdf.com/dependent-lists/

Votes

Translate

Translate
Community Expert ,
Jun 27, 2017 Jun 27, 2017

Copy link to clipboard

Copied

The location depends on the kind of code you wrote... If this script is associated with a single field you can place it under that field's appropriate action (Validation/Keystroke/etc.). If you want to put it in a function and have it as a doc-level script you can do so via Tools - JavaScript - Document JavaScripts.

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
New Here ,
Jun 27, 2017 Jun 27, 2017

Copy link to clipboard

Copied

Okay, so what I'm thinking is that it's a combination of both. I'll need to have a field level javascript inserted into the particular field, but then have that connect or communicate wit ha particular document level script where another trigger is executed. Does that sound correct? Because the validation comes from when a certain field is selected - then that triggers something else to happen in another field in the document which I believe needs to be coded into the document level.

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
Community Expert ,
Jun 27, 2017 Jun 27, 2017

Copy link to clipboard

Copied

No, you can put everything under the field's event.

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
Community Expert ,
Jun 27, 2017 Jun 27, 2017

Copy link to clipboard

Copied

I created a sample that makes this much easier. You can just copy the drop downs out of the form and edit them to your needs. See the URL below.

http://practicalpdf.com/dependent-lists/

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
New Here ,
Jun 27, 2017 Jun 27, 2017

Copy link to clipboard

Copied

LATEST

Thanks so much! This was exactly what I was looking for, and have been struggling for a few days with. Problem solved!

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