How to autopopulate multiple dropdown boxes?

New Here ,
Oct 14, 2021 Oct 14, 2021

Copy link to clipboard

Copied

Hello, I am currentlytrying to autopopulate dropdown boxes based upon one master dropdown box(Request). 

The script I have so far is: 

if (!event.willCommit) {

    var ve = event.changeEx;

    var f = this.getField("AS");

    if (ve == "I") {

        f.value = "NA";

    }

    else if (ve == "Q") {

        f.value = "NA";

    }

else if (ve == "L") {

        f.value = "NA";

    }

 

    else {

        this.resetForm([f.name]);

    }

}

 

This script works for the set but I desire to create another script for another field based upon this masterdropdown(Request) list. 

 

When I try to do so with the current code adjusting just the getfield  I notice it negates some of the previously working code. Important to note that I copy this code and only chance the getfield and paste it in. 

 

Any and All advice would be greatly appreciated. 

TOPICS
Create PDFs , Edit and convert PDFs , How to , JavaScript , PDF forms

Views

78

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
New Here ,
Oct 14, 2021 Oct 14, 2021

Copy link to clipboard

Copied

I am using Adobe Acrobat Pro DC 2021

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 ,
Oct 15, 2021 Oct 15, 2021

Copy link to clipboard

Copied

To see how the complete code is walking on itself we'd need to see the complete code. Post the whole script you are using.  Also you need to explicit about where the script is placed. It appears to be a keystroke script.

 

 

 

 

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
New Here ,
Oct 15, 2021 Oct 15, 2021

Copy link to clipboard

Copied

Hello, I actually ended up figuring this one out on my own.

 

Once I read up  on if/else statements I was able to work it out. 

 

Thank you for your assistance though!

 

 

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
Explorer ,
Aug 16, 2022 Aug 16, 2022

Copy link to clipboard

Copied

Mind sharing? I know it's been close to a year.

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 ,
Aug 22, 2022 Aug 22, 2022

Copy link to clipboard

Copied

LATEST

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