Calculating the total of linked Checkboxes and numeric text fields
Hi all.
I am very new at this but I am in desperate need of help. I am creating an Adobe form where I want to calculate the money value in a text field that is only calculated when the checkbox is ticked. I have come up with this code to do it and it is kind of working but not 100%.
event.value = 0;
if (this.getField("SCB1").value != "Off")
event.value+= (this.getField("S1").value);
if (this.getField("SCB2").value != "Off")
event.value+= (this.getField("S2").value);
if (this.getField("SCB3").value != "Off")
event.value+= (this.getField("S3").value);
SCB1 is Checkbox 1 and S1 is the text field
I was so excited that this was working until I started adding more SCBs linked to Ss. Instead of creating a running total in the subtotal text field, it is doing something weird. When I check SCB1 with '50.00' in S1, the total show '50.00' but when I add a check to SCB2 with '50.00' in S2, the total shows '5050.00'.
This is literally my first code that I am writing and I don't know how to fix it. If you can help within the next day or two, it would be a huge help!
