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

IF statements

JORO-David
Registered: Apr 14 2009
Posts: 25

I have several combo boxes working perfectly and want to use the data in them to auto-populate text fields, using IF statements.

ie:
ComboBox1 = "red"
ComboBox2 = "rose"

I want TextBox1 to be populated using this logic:
if (ComboBox1="red" & ComboBox2="rose"), then TextBox1="love", else TextBox2="not love"

Can somebody please help me with both the javascript syntax and let me know how/where I place the script to let TextBox1 function the way I want it to.

Thanks!

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
What you are asking about is Core JavaScript syntax. For this you should get a book on JavaScript. My favorite is the O'Reilly book, "JavaScript, the Definitive Guide".

How you actually get and set the form field values depends on the forms technology your are using. Is this an AcroForm or a LiveCycle form?

Here is an article on using ComboBoxes, it provides samples for both technologies:
http://www.acrobatusers.com/tutorials/2007/js_list_combo_livecycle/

You can find video tutorials on basic core javascript at www.pdfscripting.com

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script