Hi all,
I am trying to use js/jquery to recode an answer from a radio button to a radio-array question. I have two radio questions with the same response options followed by the array question on the same page and hidden with JS.
The array has 2 subquestions and the same number of answer options as the radio questions. So if someone selects option 3 for the first radio button and option 4 for the second, the array should fill option 3 for the first sub question and option 4 for the second sub-question.
I have seen the various other posts on setting some default values for all rows in an array, but I can't seem to figure out how to set just one without cycling all the rows.
I have no problem with the conditionals, or the getting the response listener to fire, it is simply what is the syntax for selecting a single option in a single array sub question?
I have tried the following (and some variations thereof) with no success:
//Various attempts to set sub-question SQ1 to answer option 3
$('input.radio:eq(3)', '#answerSidXGidXQidSQ1').attr('checked', true);
$('input.array:eq(3)', '#answerSidXGidXQidSQ1').attr('checked', true);
$("input#answerSidXGidXQidSQ13").attr('checked', true);
$('#questionQidSQ1 input.radio:eq(3)').attr('checked', true);
$('#questionQidSQ1 input.array:eq(3)').attr('checked', true);
I imagine the solution is something similar, and I am just missing something. Any help would be most excellent.
Cheerio,
Dan