Quantcast
Channel: Topics in Category: Can I do this with LimeSurvey? - LimeSurvey forums
Viewing all articles
Browse latest Browse all 17529

Default answer in array with 1 subquestion and 7 answer options - by: scolwell

$
0
0
I have set up an array to act like a semantic differential question. See picture attached. I want the 4th radio button to be checked by default. Based on previous forum postings I am using the following code in the question source. This sets the first radio button to be the default, as per the picture, but I can't figure out how to get the 4th one as the default. Any thoughts?

<script type="text/javascript" charset="utf-8">

$(document).ready(function(){

var qID = 146174;

// Loop through the rows and check the first radio if none are already checked
$('#question'+qID+' table.question tbody tr').each(function(i) {
if($('input.radio:checked', this).length == 0) {
$('input.radio:eq(0)', this).attr('checked', true);
}
});
});

</script>

Thanks,

Scott

Viewing all articles
Browse latest Browse all 17529

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>