Got one hell of a problem here that I've been trying to throw whatever I can at but to no avail...
The top half of my JS is absolutely fine. What I need to do is push the contents of the vars adults, seniors, YA2224, YA1821, juniors & kids into another question... reason being is that the question is not mandatory, but I have to calculate based off the back of the responses (0 is code 1 so I need to minus 1 from each response, blank = 0 so -1 once I subtract)
I'm stuck with SetSelect
So basically, what I want to do is
STPI2RECALC_r1_c1 = STPI2_r1_c1
EXCEPT where STPI2_r1_c1 is blank, then recode STPI2RECALC_r1_c1 = 1
Any idea what I need to do with the bottom part of my code?
It has to run on the JS verification part, the next question uses these calcs with a skip logic. After clicking next.
Appreciate any tips!
var strErrorMessage = "";
var adults = SSI_GetValue("STPI2_r1_c1");
var seniors = SSI_GetValue("STPI2_r2_c1");
var YA2224 = SSI_GetValue("STPI2_r3_c1");
var YA1821 = SSI_GetValue("STPI2_r4_c1");
var juniors = SSI_GetValue("STPI2_r5_c1");
var kids = SSI_GetValue("STPI2_r6_c1");
if (adults < 2 && seniors <2 && YA2224 <2 && YA1821 <2)
strErrorMessage = 'Please select at least one ticket aged 18+';
if(adults < 2)