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

If, else script?

gadgetman
Registered: Nov 2 2007
Posts: 14

Is there a way to have a form field set to contain a certain value IF the contents of another field contains a certain value.

For instance... if a field titled NAME contains "Smith", then the field titled NUMBER would contain "5". Otherwise the NUMBER field should be blank. I assume its gotta be done w/ a script, and if so, can someone help me out w/ it by letting me know what the script should be and which field to enter it in?? If not, is there another way to do it?

I'm using a Mac with Acrobat 8 professional

smit462
Registered: May 20 2006
Posts: 20
try inserting the following as a Custom calculation script for the NUMBER field:

var N = this.getField("NAME").value;
if (N == "Smith"){this.getField("NUMBER").value = 5;}
else {this.getField("NUMBER").value ="";}

STEVE MITTEL
Senior Forms Designer
Texas Comptroller of Public Accounts