Answered
I have a field named "Price".
I need a javascript that will change the calculate property of this field to be "Value is the sum (+) of the following fields:"
The fields being added would be for example be "A" and "B"
The code below seems close, but sets the property to a "custom calculation script", when I just want the built in sum (+) option for the two fields being added.
this.getField("Price").setAction("Calculate","A,B");
Have you tried the 'AFSimple_Calculate()' function that is used by this GUI?
this.getField("Price").setAction('Caclulate', "AFSimple_Calculate(\"SUM\", \"A, B\");" );
Of course it is just as easy to use the custom javascript field.
this.getField("Price").setAction('Calculate', "event.value = Number(this.getField(\"A\").value) + Number(this.getField(\"B\").value);" );
George Kaiser