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

question about if's

nahpishtim
Registered: Oct 12 2009
Posts: 30

Ok so I have picked up two books one on javascripting and one on acrobat form scripting. I've been doing pretty well with the if, else if and else commands and most of the other still simple ones with their help.

My problem is I can't seem to find anything on a "and if" so to speak. I have some fairly long and complex else if's but I now need to get one made that first check if two or three forms have a specific value and one is greater than or equal to another before it calculates each else if.

The other option I can't find a command for is if form 1 OR 2 has a specific value calculate.

I would appreciate an example of either one of these I've tried looking through as much of the forums as I can but haven't found anything here either.

My Product Information:
Acrobat Pro 8.1.3, Windows
try67
Expert
Registered: Oct 30 2008
Posts: 2399
http://w3schools.com/js/js_comparisons.asp

I'm sure the books you bought contain this information as well. If not, demand a refund.

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
You are using a product that can create forms using Acrobat AcroForm Tools or LiveCycle Designer. Acrobat AcroForms Acrobat JavaScript does not always work in LiveCycle Designer.

It is necessary that you tell which program you are using the create forms.

And if LiveCycle Designer are you using FormCalc or JavaScirpt?

The 'if' statement has a required parameter of a 'statement' and this statement needs to reduce or evaluate to either a logical 'true' or 'false' result.

The statement can be a simple statement or complex. A simple statement consist of one statement and a complex consists of one or more simple statements connected by use of a logical 'AND' or 'OR'.

// a simple if statement exampleconsole.show();console.println('result is true');var bTest = true;if(bTest == true) {console.println('bTest is ' + (bTest == true);} else {console.println('bTest is ' + (bTest == true);} console.println('result is false');bTest = true;if(bTest == true) {console.println('bTest is ' + (bTest == true);} else {console.println('bTest is ' + (bTest == true);}

// a complex statement testconsole.show();var bTest1 = true;var bTest2 = true;if( bTest1 == true & bTest2 == true) {console.println('Both test are true');} else {if(bTest1 == true) {console.println('Test 1 true, Test 2 false');} else {if(bTest2 == true) {console.println('Test 2 false, Test 2 true');}else {console.println('Test 2 false, Test 2 false');} // test 1 false, test 2 true} // end 1 - true, 2 false} // end 1 - true, 2 - true

Their are also other coding statements and techniques that could be used.

George Kaiser