Survey skip logic in PDF form
Hi,
I am creating a basic PDF form survey with radio button yes/no questions and next / back buttons to show each page. When the user pushes the "next" button on page 20, page 21 needs to be shown only IF 3 previous questions on depression (1,2, and 3) OR three previous questions on irritability (6,7, and 😎 were answered yes (yes = 1, no = 0).
Here is the code that is ALMOST working:
Document level JS
var depressionchecklist = this.getField("Q1"+"Q2"+"Q3").valueAsString;
var irritabilitychecklist = this.getField("Q6"+"Q7"+"Q8").valueAsString;
JS for the "next" button on page 20
if ( depressionchecklist == "3" || irritabilitychecklist == "3" ) {
this.pageNum = this.pageNum = 20;}
else {this.pageNum = 21; }
Right now, even when the depression and irritability questions are all answered yes, when I hit the next button on page 20, it automatically skips to page 22 (it reverts to the else statement).
It's probably some simple mistake with the code.... Any ideas?
