Have an idea?

Visit Sawtooth Software Feedback to share your ideas on how we can improve our products.

same page question responses show next question in same page

hi,

I have a question S44, if S44 responds in 1 then show s45 on the same page, or if responses are 2 the show s46 on the same page, s44 is a single code select question.

total 7 questions on one page. s45 or s46 base on S44 responses,
(S44, S45, s46, S43,S43a,S43b and S47)
S45 or S46 not show when ask the s44, please anyone help me..
asked Apr 10 by Ali Raza Bronze (820 points)

1 Answer

0 votes
"Branching" from the Community Question Library is a tool for creating functionality like this.  You can download it and import it into your question library from here:

https://sawtoothsoftware.com/resources/question-library/branching

Based on your question, your "branchings" part of the script needs to look something like this:

    branchings: [
        {
            dependentQuestion: 'S45',
            condition: function() {
                return SSI_GetValue('S44') == 1;
            }
        },
        {
            dependentQuestion: 'S46',
            condition: function() {
                return SSI_GetValue('S44') == 2;
            }
        }
    ],
answered Apr 12 by Zachary Platinum Sawtooth Software, Inc. (174,325 points)
Which question to put in the branching question?
these codes put in branching question or S44?

 branchings: [
        {
            dependentQuestion: 'S45',
            condition: function() {
                return SSI_GetValue('S44') == 1;
            }
        },
        {
            dependentQuestion: 'S46',
            condition: function() {
                return SSI_GetValue('S44') == 2;
            }
        }
    ],
The code I posted goes into the Branching question.  No code ever needs to be put in the non-Branching questions to make Branching work, but the dependent questions need to be set to not require a response.
...