Adobe Acrobat Pro Dc Custom calculation script add multiple fields depending on what number is entered into another field

New Here ,
Oct 16, 2017

Copy link to clipboard

Copied

I am creating a form in which the user enters the Total number of travelers "NumbTravTot" from 1 through 4.

I also have 3 separate field titled "TotMeal1", "TotMeal2" and "TotMeal3".

I need to create 4 separate fields for each traveler that if the "NumbTravTot" field = a certain number, the respective traveler field will add all 3 of the "TotMeal1", "TotMeal2" and "TotMeal3" together and show that total amount.

If the "NumbTravTot" field is a "1", then only the lower field for Traveler 1 "TotalMealTrav1" will populate the added amounts.  The other 3 traveler fields will state: "$0.00".

If the "NumbTravTot" field is a 2, then both the lower fields for Traveler 1 "TotalMealTrav1" and Traveler 2 "TotalMealTrav2" will populate with the added amounts (showing the same total for both).  The remaining Traveler Fields will show "$0.00".

The remaining "TotalMealTrav3" and "TotalMealTrav4" fields will follow suit depending on if a 3 or a 4 is entered into the "NumbTravTot".

TOPICS
Acrobat SDK and JavaScript, Windows

Views

246

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Adobe Community Professional ,
Oct 16, 2017

Copy link to clipboard

Copied

I would start by reading/viewing some of the tutorials posted by Adobe or in the Acrobat Users Community.

You may need to more clearly and fully define your problem so it is not so vague. "a certain number" is not very clear and you may need to either limit the input for certain fields to specific numbers or a range of numbers so you do not need to deal with values outside of the valid range of values.

Acrobat form fields use JavaScript as the custom programming language with some special features unique to Acrobat. Adobe provides the reference manual and guide for free.

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more