Highlighted

Calculate a form field

New Here ,
Sep 15, 2020

Copy link to clipboard

Copied

I am trying to create a fillable form for a clothing order for our company.  I want to have a drop down list of our clothing options to order ( Sweatshirt, Tshirt,etc.).  Some shirts have different sizes available so I would like for when they select their option in the first drop down list, that the second drop down would populate just the sizes available for that clothing option.  Is this even possible?

 

Disclaimer- I'm very new to Adobe, so I need a lot of help and dumbing down of answers- Thanks! 🙂

TOPICS
How to, PDF forms

Views

47

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

Calculate a form field

New Here ,
Sep 15, 2020

Copy link to clipboard

Copied

I am trying to create a fillable form for a clothing order for our company.  I want to have a drop down list of our clothing options to order ( Sweatshirt, Tshirt,etc.).  Some shirts have different sizes available so I would like for when they select their option in the first drop down list, that the second drop down would populate just the sizes available for that clothing option.  Is this even possible?

 

Disclaimer- I'm very new to Adobe, so I need a lot of help and dumbing down of answers- Thanks! 🙂

TOPICS
How to, PDF forms

Views

48

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
Sep 15, 2020 0
BarlaeDC LATEST
Adobe Community Professional ,
Sep 15, 2020

Copy link to clipboard

Copied

Hi,

 

This is fairly easy to do, if you place a script similar to this on the validate (validate, see image below) of the first drop down ( the Sweatshirt. tshirt) one, and make sure the name in the getField method is the size drop you want. Then code like this should work.

var otherDD = this.getField("Dropdown2"); // change to match name of your size dropdown.
console.println ( event.value);

if (event.value == "T-Shirt") {
otherDD.clearItems();
otherDD.insertItemAt("Small");
otherDD.insertItemAt("Medium");
} else if ( event.value == "Sweatshirt"){
otherDD.clearItems();
otherDD.insertItemAt("Medium");
otherDD.insertItemAt("Large");
}

You also want to make sure the option for "Commit Selected value immediately" is checked on the properties dialog

BarlaeDC_0-1600184290672.png

 

Hope this helps

 

Malcolm

 

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
Reply
Loading...
Sep 15, 2020 0