Validate multiple radio groups before form submit
<p>All,
I've got the following bit of HTML code to display a form with some radio boxes on it:</p>

<pre><code>&lt;tr id="row1"&gt;
    &lt;td align="center"&gt;
        &lt;b&gt;Dancefloor&lt;/b&gt;
        &lt;input type="hidden" name="question_id[]" value="2"&gt;
    &lt;/td&gt;
    &lt;td align="center"&gt;
        &lt;div style="text-align:center;"&gt;
            &lt;input type="radio" name="rating_value_2" id="rating_value_2" value="5"
            required&gt;
        &lt;/div&gt;
    &lt;/td&gt;
    &lt;td align="center"&gt;
        &lt;div style="text-align:center;"&gt;
            &lt;input type="radio" name="rating_value_2" id="rating_value_2" value="4"&gt;
        &lt;/div&gt;
    &lt;/td&gt;
    &lt;td align="center"&gt;
        &lt;div style="text-align:center;"&gt;
            &lt;input type="radio" name="rating_value_2" id="rating_value_2" value="3"&gt;
        &lt;/div&gt;
    &lt;/td&gt;
    &lt;td align="center"&gt;
        &lt;div style="text-align:center;"&gt;
            &lt;input type="radio" name="rating_value_2" id="rating_value_2" value="2"&gt;
        &lt;/div&gt;
    &lt;/td&gt;
    &lt;td align="center"&gt;
        &lt;div style="text-align:center;"&gt;
            &lt;input type="radio" name="rating_value_2" id="rating_value_2" value="1"&gt;
        &lt;/div&gt;
    &lt;/td&gt;
&lt;/tr&gt;
&lt;tr bgcolor="#FFFFFF" id="row2"&gt;
    &lt;td align="center"&gt;
        &lt;b&gt;Client Satisfaction&lt;/b&gt;
        &lt;input type="hidden" name="question_id[]" value="3"&gt;
    &lt;/td&gt;
    &lt;td align="center"&gt;
        &lt;div style="text-align:center;"&gt;
            &lt;input type="radio" name="rating_value_3" id="rating_value_3" value="5"
            required&gt;
        &lt;/div&gt;
    &lt;/td&gt;
    &lt;td align="center"&gt;
        &lt;div style="text-align:center;"&gt;
            &lt;input type="radio" name="rating_value_3" id="rating_value_3" value="4"&gt;
        &lt;/div&gt;
    &lt;/td&gt;
    &lt;td align="center"&gt;
        &lt;div style="text-align:center;"&gt;
            &lt;input type="radio" name="rating_value_3" id="rating_value_3" value="3"&gt;
        &lt;/div&gt;
    &lt;/td&gt;
    &lt;td align="center"&gt;
        &lt;div style="text-align:center;"&gt;
            &lt;input type="radio" name="rating_value_3" id="rating_value_3" value="2"&gt;
        &lt;/div&gt;
    &lt;/td&gt;
    &lt;td align="center"&gt;
        &lt;div style="text-align:center;"&gt;
            &lt;input type="radio" name="rating_value_3" id="rating_value_3" value="1"&gt;
        &lt;/div&gt;
    &lt;/td&gt;
&lt;/tr&gt;
&lt;tr id="row3"&gt;
    &lt;td align="center"&gt;
        &lt;b&gt;Overall Gig&lt;/b&gt;
        &lt;input type="hidden" name="question_id[]" value="1"&gt;
    &lt;/td&gt;
    &lt;td align="center"&gt;
        &lt;div style="text-align:center;"&gt;
            &lt;input type="radio" name="rating_value_1" id="rating_value_1" value="5"
            required&gt;
        &lt;/div&gt;
    &lt;/td&gt;
    &lt;td align="center"&gt;
        &lt;div style="text-align:center;"&gt;
            &lt;input type="radio" name="rating_value_1" id="rating_value_1" value="4"&gt;
        &lt;/div&gt;
    &lt;/td&gt;
    &lt;td align="center"&gt;
        &lt;div style="text-align:center;"&gt;
            &lt;input type="radio" name="rating_value_1" id="rating_value_1" value="3"&gt;
        &lt;/div&gt;
    &lt;/td&gt;
    &lt;td align="center"&gt;
        &lt;div style="text-align:center;"&gt;
            &lt;input type="radio" name="rating_value_1" id="rating_value_1" value="2"&gt;
        &lt;/div&gt;
    &lt;/td&gt;
    &lt;td align="center"&gt;
        &lt;div style="text-align:center;"&gt;
            &lt;input type="radio" name="rating_value_1" id="rating_value_1" value="1"&gt;
        &lt;/div&gt;
    &lt;/td&gt;
&lt;/tr&gt;
&lt;div id="radio_group_error"&gt;&lt;/div&gt;
</code></pre>

<p>This code gets generated from some PHP code so there can be one group of radio buttons or multiple. What I would like to do is make sure that at least one radio button is selected for each group on the page (using jQuery to do this check). If at least one radio group isn't selected then I'd like an error displayed in the radio_group_error div.</p>

<p>Any ideas on how to do this since there can be one or many different radio groups for this?</p>

<p>If anyone can edit this code to make it look better, feel free! (Thanks Colin)</p>
