Adding form verification in this case
<p>I've got 3 groups of radio buttons and 1 set of check boxes.
How do i check if a radio button is selected in each group of radio buttons and at least one check box is selected? And if not, maybe pop an alert window.
So thats : one radio button needs to be selected from all three groups and one check box (all four are mandatory). I've had no luck with this. Thanks</p>

<pre><code>&lt;html&gt; 
&lt;head&gt; 
&lt;script type="text/javascript"&gt; 
function DisplayFormValues() 
{ 
var str = ''; 
var elem = document.getElementById('frmMain').elements; 


for(var i = 0; i &lt; elem.length; i++) 
{
if(elem[i].checked)
{
str += elem[i].value+"&lt;br&gt;";
}
} 

document.getElementById('lblValues').innerHTML = str; 
document.frmMain.reset();
} 

&lt;/script&gt; 
&lt;/head&gt; 
&lt;body&gt; 

&lt;form id="frmMain" name="frmMain"&gt; 
Set 1
&lt;INPUT TYPE="radio" NAME="r1" value="r1a"&gt;
&lt;INPUT TYPE="radio" NAME="r1" value="r1b"&gt;
&lt;INPUT TYPE="radio" NAME="r1" value="r1c"&gt;
&lt;br&gt;
Set 2
&lt;INPUT TYPE="radio" NAME="r2" value="r2a"&gt;
&lt;INPUT TYPE="radio" NAME="r2" value="r2b"&gt;
&lt;INPUT TYPE="radio" NAME="r2" value="r2c"&gt;
&lt;br&gt;
Set 3
&lt;INPUT TYPE="radio" NAME="r3" value="r3a"&gt;
&lt;INPUT TYPE="radio" NAME="r3" value="r3b"&gt;
&lt;INPUT TYPE="radio" NAME="r3" value="r3c"&gt;
&lt;br&gt;
Check 1
&lt;INPUT TYPE="checkbox" NAME="c1" value="c1a"&gt;
&lt;INPUT TYPE="checkbox" NAME="c1" value="c1b"&gt;
&lt;INPUT TYPE="checkbox" NAME="c1" value="c1c"&gt;

&lt;input type="button" value="Test" onclick="DisplayFormValues();" /&gt; 
&lt;/form&gt; 
&lt;hr /&gt; 
&lt;div id="lblValues"&gt;&lt;/div&gt; 

&lt;/body&gt; 
&lt;/html&gt;
</code></pre>
