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

ADOBE PRO Multiple values exported from dropdown menu

New Here ,
Jan 03, 2023 Jan 03, 2023

Copy link to clipboard

Copied

I am creating an invoice and I have created a dropdown with a list of items and set values to be exported for the invoice.

I have the invoice running well (calculated totals etc.)

The only issue I am having is I now need to have a second value exported so when a user selects a product, it will also display a prefilled description of the item or work done. ideally this box could be editable but not required.

Example:

I need

Dropdown1

which has product 1 @ $1
product 2 @ $2

product 3 @ $2

I need a separate text box underneath this dropdown to populate with a description of each product in a textbox labeled textbox1 when any product is selected by the user.

 

Any help on this is appreciated

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

Views

683

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 ,
Jan 03, 2023 Jan 03, 2023

Copy link to clipboard

Copied

You can use something like this as 'Validation' script of dropdown field, it will allow to easily manage descriptions:

var f = this.getField("textbox1");
var str = [
{product: "default value", description: ""},
{product: "Product 1",     description: "Product 1 description"},
{product: "Product 2",     description: "Product 2 description"},
{product: "Product 3",     description: "Product 3 description"}];
for(var i in str){
if(event.value == str[i].product)
f.value = str[i].description;}

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 ,
Jan 04, 2023 Jan 04, 2023

Copy link to clipboard

Copied

This worked perfectly thanks!

Do you by chance know how to also get my dropdown menu to allow for one customizable entry, i.e they all are set to commit value automatically for calculation. I want to add a dropdown option of "---Select here to input custom entry---" with a value of any numerical dollar system metric number the user types in.

I am not sure if this is possible, I am even open to using a checkbox to getting an editable price button, I am new to java coding so any further help is appreciated!

Example:

Dropdown1

which has "product 1" @ $1 - auto commits value to price
"product 2" @ $2 - auto commits value to price

"product 3" @ $2 - auto commits value to price

"---Select here to input custom entry---" <---allows for custom written entry @ "$  " Allows Any amount user inputs (valid us dollar variations)

Thanks again!

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 ,
Jan 04, 2023 Jan 04, 2023

Copy link to clipboard

Copied

You can check 'Allow user to enter custom text' in dropdown field under 'Options' tab.

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 ,
Jan 04, 2023 Jan 04, 2023

Copy link to clipboard

Copied

This fixes the custom entry but is there a way to allow for the exported values in my price textbox "price1" it allows me to type any number but the moment I leave it reverts back to value thats in dropdown.

I.e. Product 3 defaults to $2 but if customer types in price $2.75 and exits box it reverts back to $2.

The same for "---Select here to input custom entry---" but it defaults to 0.00

Not if if this was explained well, I am very new to Adobe/js.

I appreciate your help and feedback you've given.

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 ,
Jan 04, 2023 Jan 04, 2023

Copy link to clipboard

Copied

The idea is to have an invoice that automatically generates set prices but if the consumer needs to change the list price for whatever reasons they can change and then make note in a notes panel.

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 ,
Jan 04, 2023 Jan 04, 2023

Copy link to clipboard

Copied

LATEST

If values revert backs in "price1" field there is probably script that affect that field, so you need to include condition to check for user entry in script.

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