These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Calc based on check box

Meabh
Registered: Feb 24 2006
Posts: 20

2 check boxes ("cb.1" & "cb.2"). 1 check box represents 300, the 2nd 120. I'm trying to bring those values into a text box "expense.1" depending on how they're checked off.

This is what I've got so far:

var e = this.getField("cb.1").value;
var f = this.getField("cb.2").value;
var g = this.getField("expense.1");
var h = 300;
var i = 120;

if (e == "$300 flat fee for mediation");
g.value = h;

if (f == "$120 failure to appear fee");
g.value = i;

if (e == ("$300 flat fee for mediation") && f == ("$120 failure to appear fee"));
g.value = h+i;

what am I missing?

Meabh

gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
There is no ";" after the "statement" in the "if" statement, it should be followed by a line or block of code to be executed. The ";" indicates the end of an executable code statement, and for the "if" statement this would include the line or block of code to be executed for a "true" condition.

Your script could be simplified by just coding the export values to the fee to be charged.

var e = this.getField("cb.1").value;
var f = this.getField("cb.2").value;

// change "Off" unchecked value to 0
if (e == "Off") e = 0;
if (f == "Off") f = 0;

event.value = e + f; // compute fee due

George Kaiser