Answered
I have an Acrobat javascript that is set up to sum several fields, then multiply the sum by 8% tax and add the sum and the tax together. It works except that if only one field has data entered into it, then the result concatenates. What do I need to add or correct so that with data in only one field, it figures the tax and adds it to the data in the field instead of concatenating the two?
Here is the script:
var sum = 0;
for(var i = 0; i < 2; i++)
{
var cFldName = "field0_" + + i;
sum += this.getField(cFldName).value;
}
event.value = sum + (sum * .08);
var sum = 0;
for (var i = 0; i < 2; i++) {
var cFldName = "field0_" + i;
sum += +getField(cFldName).value;
}
event.value = 1.08 * sum;
George