Answered
Hello,
I have 3 check boxes that when checked, show different pages of the form that are hidden until checked. I have a button that, when clicked should navigate to the first page of the visible pages, but it doesn't work. So, if two of the boxes are checked, I want the button to navigate to the page of the first check box.
My question is, how do you write an if statement that has multiple variables?
I have tried the following, but neither of them work:
if (field1.presence = "1") && (field2.presence == "0") && (field3.presence == "0"))
{xfa.host.currentPage = 2;}
if (field1.presence = "1") || (field2.presence == "0") || (field3.presence == "0"))
{xfa.host.currentPage = 2;}
Any insight would be greatly appreciated.
1. The opening parentheses is misssing
2. The first condition, on "field1", is an assignment, not a comparison. Use "=="
There is also a usage error. The value of the "presense" property is one of "hidden", "invisible", or "visible".
Other than that your code looks good.
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]
Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script