- Step 1: Create a (hidden, if you wish) text field called "Counter".
- Step 2: Apply the following code as the MouseUp event of the button field:
var counter = Number(this.getField("Counter").valueAsString);
if (counter<7) this.getField("Counter").value = counter+1;
- Step 3: Apply the following code as the custom Calculation script of "Text2":
event.value = Number(this.getField("Counter").valueAsString) + "/7 points used";
- Step 4: Apply the following code as the custom Calculation script of "Text3":
event.value = Number(this.getField("Counter").valueAsString)*20;
That's all there is to it.