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

Calculate based on Checkbox

shinymcshires
Registered: Jan 2 2008
Posts: 4

I am a javascript neophyte and I'm on Designer 7.0. I'd like to calculate a 10% penalty if the client clicks a checkbox. I tried the following javascript statement for the checkbox:

if (this.rawValue == true)

{Penalty.rawValue = remittanceamount*.1;}

else {Penalty.rawValue = 0;}

The calculation does not seem to work with the rawValue expression. I think it is meant for constant values, as I was able to get the following to work:

if (this.rawValue == true)

{Penalty.rawValue = 10;}

I would appreciate any help you may be able to provide. Thank you!

gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
Do not mix AcroForms JavaScript ("this.") with LiveCycle Designer JavaScript("$."). Assuming the checked value has an integer value of "1" (default):

if ($.rawValue == 1)
{
Penalty.rawValue = remittanceamount.rawValue * 0.1;
} else {
Penalty.rawValue = 0;
}

George Kaiser