Quantcast
Viewing all articles
Browse latest Browse all 17529

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

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