Help with Drop down list fields and sum fields
- May 30, 2025
- 1 reply
- 192 views
Hello! I am creating a form with a summary page and then detail pages for each quarter. I am trying to calculate a sum on the summary page that will show the total amount from the detail page based on the drop-down list selection. I have a total of 35 rows on each of the detail list pages. Each row contains the same dropdown list and a total field that calculates the unit cost x quantity (which is manually entered). I need a total sum amount for each item in my drop down list. I have tried the following javascript but it is not working. Any suggestions or help?
var total = 0;
for (var i=1; i<=35; i++) {
if (this.getField("1stQtrComponentRow"+i).valueAsString=="Food")
total+=Number(this.getField("1stQtrTotalRow"+i).valueAsString);
}
event.value = total;
