Skip to main content
Participating Frequently
May 22, 2019
Question

Calculating Quantities in Order form

  • May 22, 2019
  • 1 reply
  • 566 views

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.

This topic has been closed for replies.

1 reply

Inspiring
May 22, 2019

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.

Participating Frequently
May 22, 2019

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.

try67
Community Expert
Community Expert
May 22, 2019

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.