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

Calculating Quantities in Order form

New Here ,
May 22, 2019 May 22, 2019

Copy link to clipboard

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

256

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

Copy link to clipboard

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.

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

Copy link to clipboard

Copied

Calculation.jpg

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.

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

Copy link to clipboard

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.

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

Copy link to clipboard

Copied

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

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

Copy link to clipboard

Copied

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

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

Copy link to clipboard

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.

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

Copy link to clipboard

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.

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