Have an idea?

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

Logic check with 2 numeric question

Dear all,

I have 2 questions Q1 and Q2 are numeric format and stay in different page.

Here my logic check.

Q2 must be less than or equal Q1.

I have tried with this script but it didn't work:

var A = SSI_GetValue("Q1");
var B = SSI_GetValue("Q2");
if (B > A)
    strErrorMessage="Q2 may not be greater than Q1";

How can i fix this? Thanks in advance.
asked Jan 21, 2018 by Saroeun Bronze (1,575 points)
retagged Jan 21, 2018 by Walter Williams

1 Answer

+1 vote
Best answer
If Q1 is on one page and Q2 is on another page, you need to define Q1 as such ...

var A = [%Q1%];

Your code looks correct if Q1 and Q2 are on the same page.
answered Jan 21, 2018 by Paul Moon Platinum (70,315 points)
selected Jan 21, 2018 by Saroeun
Great thanks, Paul.