Javascript for radio group
<p>I have used a javascript to check if radio button is checked or not. If it is not checked than I return false. But my Js is not working for that...</p>

<pre><code>       //Gender
if ((document.addpcpform.gender[0].checked == false) &amp;&amp; (document.addpcpform.gender[1].checked == false)) {
    alert("Please choose your gender: Male or Female");
    return false;
}
</code></pre>

<p>Form name = <code>addpcpform.</code>, radio button name = <code>gender</code>.</p>

<p>If I use Id of radio at place than also it fails to run.</p>

<pre><code>       //Gender
if ((document.addpcpform.Male.checked == false) &amp;&amp; (document.addpcpform.Female.checked == false)) {
    alert("Please choose your gender: Male or Female");
    return false;
}
</code></pre>
