How to check if everything in the loop is true?
<p>I have a simple multiple question form, each question has 4 answers and users must select 1 answer for each question. </p>

<p>So far I can check for an unanswered question and show an error message. </p>

<p>But now if all questions have been answered, I need the form to go to a results page (I assume <code>window.location</code>?)</p>

<p>How can I check if all questions have been answered?</p>

<pre><code>$('.submit-button').click(function(event){
    $('.validate-message').hide();

    for (var i=1;i&lt;6;i++) {
        var input = $("input[name=q"+i+"]");
        var inputChecked = $("input[name=q"+i+"]:checked");

        if (!inputChecked.val()) { //if an answer is not selected for a question
            $(input).parents('fieldset').append('&lt;div class="validate-message" style="color:red;"&gt;Please choose an answer!&lt;/div&gt;');

        } else { // if an answer is selected for a question
        }
    }       
    return false;          
});
</code></pre>
