I have form fields named Qty1, Qty2, Qty3 and I'd like to mutiply each Qty with a set of fixed numbers - 128, 26, and 35 respectively, and then calculate the sum of all 3 results?
i.e. (Qty1*128)+(Qty2*26)+(Qty3*35) ?
I tried this :
var a = this.getField(Qty1).value;
var b = this.getField(Qty2).value;
var c = this.getField(Qty3).value;
event.value = (a.value * 128) + (b.value * 26) + (c.value * 35);
But doesn't work... please help?
You forgot to put your getField names in quotes.
You also were attempting to get the value of a field object when you had predefined the variable to have it assigned as the variable value already.