Expand my Community achievements bar.

SOLVED

Script to exclude field from calculations

Avatar

Level 3

Merry Christmas everyone.

I am creating a form in Designer that includes a calculation.  I need script to set the value of a particular field to zero and then exclude it from re-calculating when a particular selection is made in a drop-down list.  Setting the presence to "inactive" works great, except that it is highly likely that some people using the form will not be using a newer version of reader.  Is there a way to do this with script? 

1 Accepted Solution

Avatar

Correct answer by
Level 3

Thank you for responding. I tried this, but I think my script is wrong:

if (Court.rawValue == 1)

{

this.rawValue = 0;

} else

{

this.rawValue = (Fine+PassFine)*.7;

}

Any suggestions.

Tracy

View solution in original post

3 Replies

Avatar

Level 7

in the calculation event of this field put an if statement around the calculations eg. (in formcalc):

if (dropdownlist1 <> 3) then

// whatever your current calculations are

else $ = 0

endif

Avatar

Correct answer by
Level 3

Thank you for responding. I tried this, but I think my script is wrong:

if (Court.rawValue == 1)

{

this.rawValue = 0;

} else

{

this.rawValue = (Fine+PassFine)*.7;

}

Any suggestions.

Tracy

Avatar

Level 7

you just need to change:

this.rawValue = (Fine+PassFine)*.7;

to

this.rawValue = (Fine.rawValue + PassFine.rawValue)*.7;