• Global community
• Language:
• Deutsch
• English
• EspaÃ±ol
• FranÃ§ais
• PortuguÃªs
• æ—¥æœ¬èªžã‚³ãƒŸãƒ¥ãƒ‹ãƒ†ã‚£
Dedicated community for Japanese speakers
• í•œêµ­ ì»¤ë®¤ë‹ˆí‹°
Dedicated community for Korean speakers
Exit
• Calculating Quantities in Order form

# Calculating Quantities in Order form

New Here ,
May 22, 2019 May 22, 2019

Copied

This is a really simple question but it isn't working well for me.

I have an order form with quantities and amounts.

I have a field called Quantity.0 and a field called Amount.0

I want whatever quantity is in the "quantity" field to calculate into the amount field.

However after creating simplified and custom, it keeps increasing my amount field as I go through my spreadsheet.

If someone wants to decrease their quantity on the form, I would like it to recalculate the amount off the new quantity.

Then at the bottom of my form, I have a total field which I want to calculate all the Amounts. I used the sum+ and reordered the fields but that isn't adding correctly.

Any help is requested.

TOPICS
Acrobat SDK and JavaScript , Windows

Views

311

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
7 Replies 7
LEGEND ,
May 22, 2019 May 22, 2019

Copied

It is not clear what the exact script is that you are using. It would be helpful to post the script and possibly link to a copy of the form you are using the script in. Be sure to include all the scripts in the form.

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
New Here ,
May 22, 2019 May 22, 2019

Copied

The script I current have in the amount boxes: event.value = ( this.getField("Amount.7").value * this.getField("Quantity.7").value )

The total field, I just used the Value is the sum+ of the following fields.

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 Expert ,
May 22, 2019 May 22, 2019

Copied

You can't use a field's own value in its calculation. That's circular logic.

You need to create another column for the price of each item.

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
New Here ,
May 22, 2019 May 22, 2019

Copied

Ok. The pricing varies so I will just remove calculations. The employees can calculate on their own.

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 Expert ,
May 22, 2019 May 22, 2019

Copied

I guess I don't understand what you're trying to achieve... Isn't Quantity and Amount the same thing?

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
New Here ,
May 22, 2019 May 22, 2019

Copied

No. I added a new column for Item amount. So that way the formula should work and calculate the quantity * the item amount = total amount.

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 Expert ,
May 22, 2019 May 22, 2019

Copied

LATEST

Ah, I see. The amount is actually the price. Well, you need to define the price-per-item somewhere. You can't use the same column for both things.