Calculate additional text fields
I'm using the following custom calculation script in a text field named 'TotalOTHrs' and it works great. However, I also need to calculate the hours from another 35 dropdowns name 'MBHrs1' to 'MBHrs35. I'm strugging with how to input that and I could sure use some much appreciated help. Thanks.
var maxFields = 35; //
var total = 0;
for (var i=1; i<=maxFields; i++) {
if (this.getField("OTPayType"+i).valueAsString!="CDO Banked")
total+=Number(this.getField("OTHrs"+i).valueAsString);
}
event.value = total;
