Still having some trouble. I got everything to work fine for both single and multiple answers. But I have one multi answer question with over 60 answer options. I have it encoded in 12 attributes, each of which can contain one of the 60 answer options.
For example for person Y, attribute_3 may contain 21, which implies answer option X21 on question 884.
The code below does the trick in simple test, though it's not elegant. But when I encode all the attribute fields for all the answer options, Limesurvey freaks and messes with the code. Which is totally rational, given the redundancy of all that code.
if('{TOKEN:ATTRIBUTE_3}' == '21') {$("input#answer74931X156X884X21").attr('checked', true);}
if('{TOKEN:ATTRIBUTE_3}' == '22') {$("input#answer74931X156X884X22").attr('checked', true);}
if('{TOKEN:ATTRIBUTE_3}' == '23') {$("input#answer74931X156X884X23").attr('checked', true);}
if('{TOKEN:ATTRIBUTE_4}' == '21') {$("input#answer74931X156X884X21").attr('checked', true);}
if('{TOKEN:ATTRIBUTE_4}' == '22') {$("input#answer74931X156X884X22").attr('checked', true);}
if('{TOKEN:ATTRIBUTE_4}' == '23') {$("input#answer74931X156X884X23").attr('checked', true);}
I guess it would be better to do it something like this:
if('{TOKEN:ATTRIBUTE_3}' == '21' OR '{TOKEN:ATTRIBUTE_4}' == '21' OF '{TOKEN:ATTRIBUTE_5}' == '21' OR ...) {$("input#answer74931X156X884X21").attr('checked', true);}
But I can't find the proper JQUERY syntax for OR statements. Any hints?