I have 2 questions in two separate pages:
S1 is a radio question with values from 1 to 6.
S2 is a grid question with numeric open text boxes.
I want to validate the values in S2 based on answers in S1.
I put the code below in the Advanced Settings Custom Java Verification area for S2 but it doesn't show the error and doesn't let me move forward.
If I put it in the footer for S2, nothing happens either. I can move to the next question with no error message.
if (
(SSI_GetValue("S2_r1_c1")<=10 && "[% S1 %]"==2) || (SSI_GetValue("S2_r1_c1")>=24 && "[% S1 %]"==2))
strErrorMessage = 'Please enter a correct value between 10 and 24.';
}
if (
(SSI_GetValue("S2_r2_c1")<=10 && "[% S1 %]"==3) || (SSI_GetValue("S2_r2_c1")>=24 && "[% S1 %]"==3))
strErrorMessage = 'Please enter a correct value between 25 and 49.';
}
What is wrong with this code? Thanks!