Hi, this is what I've got so far.
The formula I have puts a value into a box, if a check box is ticked. What I need to do is have it add up multiple values, if several boxes are ticked.
if (getField("1stBox").value=="Yes")
event.value = getField("M").value;
else event.value = "0"
So I need to say
Also check
"PBox" (a check box)
and add "PValue" (a pre-determined number)
Also check
"JLBox" (a check box)
and add
"JLValue" (a pre-determined number)
and last of all, always add anything typed in the "CCBox" (a variable number)
I just don't know to make the multiple if statements add together, and also work so they can run independantly, i.e. it doesn't matter if one box is ticked or not for it to check the others. Hope that makes sense?
var mySum ; // define a variable to sum up; not needed, but for clarity of this code sample required
mySum += this.getfield("myCheckBox").value.replace(/Off/gi, "0") *1 ;
and that should do it. We need to do the replace() because the value of an unchecked checkbox is "Off", and to make sure that we have a number, we multiply the value with 1.
Hopte this can help.
Max Wyss.