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

if statement

Anonymous

Hi all,

I was hoping someone could help me!

I have 3 check boxes called "Self", "Manager" and "agreed". Ideally what i would like is that when the Self and Manager field is ticked, the Agreed filed get automatically ticked as well.

I thought the best way to do this is via an if, else statement but i cant get it too work can anyone help me please?

I tried something like this;

var cSelf = this.getField("Self").value;
var cManager = this.getField("Manager").value;
var cTotal= cSelf + cManager;

if( cTotal == 2 )
app.alert("Hello");

this works so far but have had no joy yet by getting the Agreed field to automatically tick,
i think i need to add this in some where f.checkThisBox(0); but am struggling, i think i could be nearly there but can t quite grasp it!! :-)

Any help would be greatly appreciated:-)

Thank you

My Product Information:
Acrobat Pro 9.3.1, Macintosh
smitchell15 (not verified)
I got there in the end!

I think i had misspelt my variable name, this is what i put and it worked a treat!
Hope this helps someone else too :-)

var cSelf = this.getField("Self").value;
var cManager = this.getField("Manager").value;
var cAgreed = this.getField("Agreed");
var cTotal = cSelf + cManager;

if( cTotal == 2 )
cAgreed.checkThisBox("0");