Hi everyone,
I have a series of matching questions on a page where respondents are required to assign brand names to logos.
There are 12 logos (= 12 questions, i.e. dropdown selects in a grid format, grid orientation set to rows)
and 20 Brand names plus a don' know option (=21 answer options).
The issue:
- each brand name should be assigned to one logo only, i.e. each answer option can be selected only once across questions
- this does not apply for the 21st answer option, as the don't know option is allowed multiple times.
I tried this as custom javascript verification:
var logos = 12; // Amount of Logos or questions
var KAValue = 21; // List value of Don't know option
var NonNotApplicableAssignments = [% ListLength(BrandNamesAssigned) %];
var Fragename = "BL02";
var KAcount = 0;
for (var i = 1; i <= logos; i++) {
if (SSI_GetValue(Fragename + '_r' + i + '_c1') == KAValue) {
KAcount += 1;
}
}
if (KAcount + NonNotApplicableAssignments < logos) {
strErrorMessage = 'Brand names cannot be assigned to different logos at the same time.';
}
where I tried to collect all answers that are not =21 (Don't Know) in a list called BrandNamesAssigned as follows:
AIC(BL02_r1_c1)
AIC(BL02_r2_c1)
AIC(BL02_r3_c1)
AIC(BL02_r4_c1)
AIC(BL02_r5_c1)
AIC(BL02_r6_c1)
AIC(BL02_r7_c1)
AIC(BL02_r8_c1)
AIC(BL02_r9_c1)
AIC(BL02_r10_c1)
AIC(BL02_r11_c1)
AIC(BL02_r12_c1)
Remove(BrandNamesToAssign,21)
I think the problem is that this list is only built after submitting the page?
Is there a better way to approach this issue?
Best
Kathrin