Count how many Radio Buttons are clicked
<p>All,
I have the following code to check to see if all of my radio button groups are checked:</p>

<pre><code>jQuery("input[type=radio]").click(function(event){
    var num_questions = jQuery("#num_questions").val(),
        new_questions = parseInt(num_questions, 10) + 1,
        radios = jQuery("input[type=radio]"),
        all_answered = true;
    for(var i=1; i&lt;new_questions; i++){
        alert(i);
        var group  = radios.filter('[name=rating_value_'+i+']');
        alert(group.filter(":checked").length);
        if(group.filter(":checked").length==0){
            all_answered = false;
            break;
        }
    }
    if (all_answered) {
        // a group was found that didn't have an answer selected
        // so do something
        jQuery("#no_answers").html('');
    } 
});
</code></pre>

<p>This works good to do the check but I have an issue. This code runs before the actual radio button has been marked as clicked so it thinks that there is still one that isn't clicked even if that was the last one. How can I fix this so that it works like I'd liek it do?</p>
